Commit 9a35d0b2 authored by Florian Müllner's avatar Florian Müllner

tests: Allow to run uninstalled

This allows running them through regular `make check`/`ninja test`
instead of requiring `gnome-desktop-testing-runner`...

!7
parent dce74c54
......@@ -5,6 +5,12 @@ test_args = [
'-DINSTALLED_TEST_DIR="@0@"'.format(test_execdir)
]
test_env = [
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
'G_ENABLE_DIAGNOSTICS=0'
]
test_programs = [
'wall-clock',
'wallclock-reftest'
......@@ -30,6 +36,11 @@ foreach program: test_programs
output: program + '.test',
)
endif
test(program,
exe,
env: test_env
)
endforeach
if get_option('installed_tests')
......
......@@ -575,7 +575,10 @@ main (int argc, char **argv)
g_test_init (&argc, &argv, NULL);
gtk_init (&argc, &argv);
basedir = INSTALLED_TEST_DIR;
basedir = g_getenv ("G_TEST_SRCDIR");
if (basedir == NULL)
basedir = INSTALLED_TEST_DIR;
file = g_file_new_for_commandline_arg (basedir);
add_test_for_file (file, NULL);
g_object_unref (file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment