From 8e78ec58e37628e39f24807551f44ca637aabd94 Mon Sep 17 00:00:00 2001 From: Ashok Sidipotu Date: Mon, 28 Nov 2022 05:23:57 +0530 Subject: [PATCH] lua tests: script tests: add a new folder Move the script-tester.c one folder up so that it is common for wplua and these tests. --- tests/meson.build | 1 + tests/{wplua => }/script-tester.c | 0 tests/scripts/meson.build | 19 +++++++++++++++++++ tests/{wplua => }/scripts/policy-tests.lua | 0 tests/wplua/meson.build | 8 +------- 5 files changed, 21 insertions(+), 7 deletions(-) rename tests/{wplua => }/script-tester.c (100%) create mode 100644 tests/scripts/meson.build rename tests/{wplua => }/scripts/policy-tests.lua (100%) 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, -)