diff --git a/tests/meson.build b/tests/meson.build index 12556414..d206ca49 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -62,6 +62,7 @@ endif subdir('wp') if build_modules subdir('wplua') + subdir('scripts') subdir('modules') endif subdir('examples') diff --git a/tests/wplua/script-tester.c b/tests/script-tester.c similarity index 100% rename from tests/wplua/script-tester.c rename to tests/script-tester.c diff --git a/tests/scripts/meson.build b/tests/scripts/meson.build new file mode 100644 index 00000000..30af4171 --- /dev/null +++ b/tests/scripts/meson.build @@ -0,0 +1,19 @@ +common_deps = [wplua_dep, pipewire_dep, wp_dep] +common_env = common_test_env +common_env.set('G_TEST_SRCDIR', meson.current_source_dir()) +common_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) +common_args = [ + '-D_GNU_SOURCE', +] + +script_tester = executable('script-tester', + '..'/'script-tester.c', + dependencies: common_deps, c_args: common_args +) + +test( + 'test-lua-event-policy-hooks', + script_tester, + args: ['policy-tests', 'policy-hooks.lua'], + env: common_env, +) diff --git a/tests/wplua/scripts/policy-tests.lua b/tests/scripts/policy-tests.lua similarity index 100% rename from tests/wplua/scripts/policy-tests.lua rename to tests/scripts/policy-tests.lua diff --git a/tests/wplua/meson.build b/tests/wplua/meson.build index 695ef7d8..616fca21 100644 --- a/tests/wplua/meson.build +++ b/tests/wplua/meson.build @@ -14,7 +14,7 @@ test( ) script_tester = executable('script-tester', - 'script-tester.c', + '..'/'script-tester.c', dependencies: common_deps, c_args: common_args ) @@ -60,9 +60,3 @@ test( args: ['lua-api-tests', 'event-hooks.lua'], env: common_env, ) -test( - 'test-lua-event-policy-hooks', - script_tester, - args: ['policy-tests', 'policy-hooks.lua'], - env: common_env, -)