libeos-parental-controls: Add placeholder unit tests

This commit is mostly to put the test framework in place, and create a
placeholder test library for libeos-parental-controls for packaging.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T23859
This commit is contained in:
Philip Withnall 2018-10-06 00:47:45 +01:00
parent dce3a94da0
commit 318b35e3da
6 changed files with 119 additions and 1 deletions

View file

@ -0,0 +1,50 @@
deps = [
dependency('gio-2.0', version: '>= 2.44'),
dependency('glib-2.0', version: '>= 2.54.2'),
dependency('gobject-2.0', version: '>= 2.44'),
libeos_parental_controls_dep,
]
envs = test_env + [
'G_TEST_SRCDIR=' + meson.current_source_dir(),
'G_TEST_BUILDDIR=' + meson.current_build_dir(),
]
test_programs = [
['app-filter', [], deps],
]
installed_tests_metadir = join_paths(datadir, 'installed-tests',
'libeos-parental-controls-' + libeos_parental_controls_api_version)
installed_tests_execdir = join_paths(libexecdir, 'installed-tests',
'libeos-parental-controls-' + libeos_parental_controls_api_version)
foreach program: test_programs
test_conf = configuration_data()
test_conf.set('installed_tests_dir', installed_tests_execdir)
test_conf.set('program', program[0])
configure_file(
input: test_template,
output: program[0] + '.test',
install: enable_installed_tests,
install_dir: installed_tests_metadir,
configuration: test_conf,
)
exe = executable(
program[0],
[program[0] + '.c'] + program[1],
dependencies: program[2],
include_directories: root_inc,
install: enable_installed_tests,
install_dir: installed_tests_execdir,
)
test(
program[0],
exe,
env: envs,
args: ['--tap'],
)
endforeach