Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libsecret
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
25
Issues
25
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
libsecret
Commits
bfa66f35
Commit
bfa66f35
authored
Jun 01, 2020
by
Niels De Graef
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
meson: Add tests for GIR-based languages
Also add a test suite argument to more easily distinguish them.
parent
d5671e37
Pipeline
#189251
passed with stages
in 15 minutes and 11 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
116 additions
and
4 deletions
+116
-4
libsecret/meson.build
libsecret/meson.build
+112
-2
tool/meson.build
tool/meson.build
+4
-2
No files found.
libsecret/meson.build
View file @
bfa66f35
...
@@ -187,13 +187,36 @@ test_cflags = [
...
@@ -187,13 +187,36 @@ test_cflags = [
'-DSRCDIR="@0@"'.format(meson.source_root()),
'-DSRCDIR="@0@"'.format(meson.source_root()),
]
]
mock_service_lib =
static_
library('mock-service',
mock_service_lib = library('mock-service',
'mock-service.c',
'mock-service.c',
dependencies: glib_deps,
dependencies: glib_deps,
c_args: test_cflags,
c_args: test_cflags,
include_directories: config_h_dir,
include_directories: config_h_dir,
)
)
if get_option('introspection')
mock_service_gir = gnome.generate_gir(mock_service_lib,
sources: files('mock-service.c', 'mock-service.h'),
namespace: 'MockService',
nsversion: '0',
export_packages: 'mock-service-0',
includes: [ 'GObject-2.0', 'Gio-2.0' ],
header: 'libsecret/mock-service.h',
)
if get_option('vapi')
mock_service_vapi = gnome.generate_vapi('mock-service-0',
sources: mock_service_gir[0],
packages: [
'gobject-2.0',
'gio-2.0',
libsecret_vapi,
],
)
endif
endif
# C tests
test_names = [
test_names = [
'test-attributes',
'test-attributes',
'test-value',
'test-value',
...
@@ -223,5 +246,92 @@ foreach _test : test_names
...
@@ -223,5 +246,92 @@ foreach _test : test_names
c_args: test_cflags,
c_args: test_cflags,
)
)
test(_test, test_bin)
test(_test, test_bin,
suite: 'libsecret',
)
endforeach
endforeach
# Tests with introspection
if get_option('introspection')
# env to be used in tests that use the typelib,
# to make sure they find the one for MockService
test_typelib_env = environment()
test_typelib_env.set('GI_TYPELIB_PATH', meson.current_build_dir())
test_typelib_env.set('LD_LIBRARY_PATH', meson.current_build_dir())
# Python Tests
pytest_names = [
'test-py-lookup',
'test-py-clear',
'test-py-store',
]
pymod = import('python')
python3 = pymod.find_installation()
foreach _pytest : pytest_names
py_test = meson.current_source_dir() / _pytest + '.py'
test(_pytest, python3,
args: py_test,
depends: mock_service_gir[1],
env: test_typelib_env,
suite: 'python',
)
endforeach
# JS Tests
jstest_names = [
'test-js-lookup',
'test-js-clear',
'test-js-store',
]
gjs = find_program('gjs', required: false)
if gjs.found()
foreach _jstest : jstest_names
js_test = meson.current_source_dir() / _jstest + '.js'
test(_jstest, gjs,
args: js_test,
depends: mock_service_gir[1],
env: test_typelib_env,
suite: 'javascript',
)
endforeach
else
message('GJS not found. Not running Javascript tests')
endif
# Vala tests
if get_option('vapi')
# FIXME: the "native" kwarg should be added once we can require meson ≥0.54
add_languages('vala')
valac = meson.get_compiler('vala')
valatest_names = [
'test-vala-lang',
'test-vala-unstable',
]
foreach _valatest : valatest_names
test_bin = executable(_valatest,
'@0@.vala'.format(_valatest),
dependencies: [
glib_deps,
valac.find_library('glib-2.0'),
valac.find_library('gio-2.0'),
libsecret_vapi,
mock_service_vapi,
],
link_with: mock_service_lib,
include_directories: config_h_dir,
c_args: test_cflags,
)
test(_valatest, test_bin,
suite: 'vala',
)
endforeach
endif
endif
tool/meson.build
View file @
bfa66f35
...
@@ -12,6 +12,8 @@ secret_tool = executable('secret-tool',
...
@@ -12,6 +12,8 @@ secret_tool = executable('secret-tool',
if get_option('gcrypt') and host_machine.system() != 'windows'
if get_option('gcrypt') and host_machine.system() != 'windows'
test('test-secret-tool.sh',
test('test-secret-tool.sh',
find_program('test-secret-tool.sh'),
find_program('test-secret-tool.sh'),
env: test_env)
env: test_env,
suite: 'secret-tool',
)
endif
endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment