From 94520716cb6ca59fc83c0c39021a085b42cda54b Mon Sep 17 00:00:00 2001 From: Kirill Isakov Date: Wed, 23 Mar 2022 12:49:09 +0600 Subject: [PATCH] Move integration tests into a subdirectory --- test/{ => integration}/algorithms.test | 0 test/{ => integration}/basic.test | 0 test/{ => integration}/command-fsck.test | 0 test/{ => integration}/commandline.test | 0 test/{ => integration}/compression.test | 0 test/{ => integration}/executables.test | 0 test/{ => integration}/import-export.test | 0 test/{ => integration}/invite-join.test | 0 test/{ => integration}/invite-offline.test | 0 test/{ => integration}/invite-tinc-up.test | 0 test/{ => integration}/legacy-protocol.test | 0 test/integration/meson.build | 64 +++++++++++++++++++++ test/{ => integration}/ns-ping.test | 0 test/{ => integration}/scripts.test | 0 test/{ => integration}/security.test | 0 test/{ => integration}/splice.c | 2 +- test/{ => integration}/sptps-basic.test | 0 test/{ => integration}/testlib.sh | 0 test/{ => integration}/variables.test | 0 test/meson.build | 63 +------------------- 20 files changed, 66 insertions(+), 63 deletions(-) rename test/{ => integration}/algorithms.test (100%) rename test/{ => integration}/basic.test (100%) rename test/{ => integration}/command-fsck.test (100%) rename test/{ => integration}/commandline.test (100%) rename test/{ => integration}/compression.test (100%) rename test/{ => integration}/executables.test (100%) rename test/{ => integration}/import-export.test (100%) rename test/{ => integration}/invite-join.test (100%) rename test/{ => integration}/invite-offline.test (100%) rename test/{ => integration}/invite-tinc-up.test (100%) rename test/{ => integration}/legacy-protocol.test (100%) create mode 100644 test/integration/meson.build rename test/{ => integration}/ns-ping.test (100%) rename test/{ => integration}/scripts.test (100%) rename test/{ => integration}/security.test (100%) rename test/{ => integration}/splice.c (99%) rename test/{ => integration}/sptps-basic.test (100%) rename test/{ => integration}/testlib.sh (100%) rename test/{ => integration}/variables.test (100%) diff --git a/test/algorithms.test b/test/integration/algorithms.test similarity index 100% rename from test/algorithms.test rename to test/integration/algorithms.test diff --git a/test/basic.test b/test/integration/basic.test similarity index 100% rename from test/basic.test rename to test/integration/basic.test diff --git a/test/command-fsck.test b/test/integration/command-fsck.test similarity index 100% rename from test/command-fsck.test rename to test/integration/command-fsck.test diff --git a/test/commandline.test b/test/integration/commandline.test similarity index 100% rename from test/commandline.test rename to test/integration/commandline.test diff --git a/test/compression.test b/test/integration/compression.test similarity index 100% rename from test/compression.test rename to test/integration/compression.test diff --git a/test/executables.test b/test/integration/executables.test similarity index 100% rename from test/executables.test rename to test/integration/executables.test diff --git a/test/import-export.test b/test/integration/import-export.test similarity index 100% rename from test/import-export.test rename to test/integration/import-export.test diff --git a/test/invite-join.test b/test/integration/invite-join.test similarity index 100% rename from test/invite-join.test rename to test/integration/invite-join.test diff --git a/test/invite-offline.test b/test/integration/invite-offline.test similarity index 100% rename from test/invite-offline.test rename to test/integration/invite-offline.test diff --git a/test/invite-tinc-up.test b/test/integration/invite-tinc-up.test similarity index 100% rename from test/invite-tinc-up.test rename to test/integration/invite-tinc-up.test diff --git a/test/legacy-protocol.test b/test/integration/legacy-protocol.test similarity index 100% rename from test/legacy-protocol.test rename to test/integration/legacy-protocol.test diff --git a/test/integration/meson.build b/test/integration/meson.build new file mode 100644 index 00000000..1c3b9ea1 --- /dev/null +++ b/test/integration/meson.build @@ -0,0 +1,64 @@ +tests = [ + 'basic.test', + 'commandline.test', + 'executables.test', + 'import-export.test', + 'invite-join.test', + 'invite-offline.test', + 'invite-tinc-up.test', + 'scripts.test', + 'security.test', + 'variables.test', +] + +if opt_crypto != 'nolegacy' + tests += 'algorithms.test' + tests += 'legacy-protocol.test' +endif + +if os_name != 'windows' + tests += 'sptps-basic.test' +endif + +if os_name == 'linux' + tests += 'ns-ping.test' +endif + +exe_splice = executable( + 'splice', + sources: 'splice.c', + dependencies: deps_common, + implicit_include_directories: false, + include_directories: inc_conf, + build_by_default: false, +) + +env = environment() +env.set('TINC_PATH', exe_tinc.full_path()) +env.set('TINCD_PATH', exe_tincd.full_path()) +env.set('SPTPS_TEST_PATH', exe_sptps_test.full_path()) +env.set('SPTPS_KEYPAIR_PATH', exe_sptps_keypair.full_path()) +env.set('SPLICE_PATH', exe_splice.full_path()) +env.set('TESTLIB_PATH', meson.current_source_dir() / 'testlib.sh') + +deps_test = [ + exe_tinc, + exe_tincd, + exe_splice, + exe_sptps_test, + exe_sptps_keypair, +] + +test_wd = meson.current_build_dir() + +foreach test_name : tests + target = find_program(test_name, native: true) + test(test_name, + target, + suite: 'integration', + timeout: 5 * 60, + env: env, + depends: deps_test, + workdir: test_wd) +endforeach + diff --git a/test/ns-ping.test b/test/integration/ns-ping.test similarity index 100% rename from test/ns-ping.test rename to test/integration/ns-ping.test diff --git a/test/scripts.test b/test/integration/scripts.test similarity index 100% rename from test/scripts.test rename to test/integration/scripts.test diff --git a/test/security.test b/test/integration/security.test similarity index 100% rename from test/security.test rename to test/integration/security.test diff --git a/test/splice.c b/test/integration/splice.c similarity index 99% rename from test/splice.c rename to test/integration/splice.c index 118d0118..07c35030 100644 --- a/test/splice.c +++ b/test/integration/splice.c @@ -17,7 +17,7 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "../src/system.h" +#include "../../src/system.h" #ifdef HAVE_MINGW static const char *winerror(int err) { diff --git a/test/sptps-basic.test b/test/integration/sptps-basic.test similarity index 100% rename from test/sptps-basic.test rename to test/integration/sptps-basic.test diff --git a/test/testlib.sh b/test/integration/testlib.sh similarity index 100% rename from test/testlib.sh rename to test/integration/testlib.sh diff --git a/test/variables.test b/test/integration/variables.test similarity index 100% rename from test/variables.test rename to test/integration/variables.test diff --git a/test/meson.build b/test/meson.build index 4b12f2e9..db719a2f 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,63 +1,2 @@ -tests = [ - 'basic.test', - 'commandline.test', - 'executables.test', - 'import-export.test', - 'invite-join.test', - 'invite-offline.test', - 'invite-tinc-up.test', - 'scripts.test', - 'security.test', - 'variables.test', -] - -if opt_crypto != 'nolegacy' - tests += 'algorithms.test' - tests += 'legacy-protocol.test' -endif - -if os_name != 'windows' - tests += 'sptps-basic.test' -endif - -if os_name == 'linux' - tests += 'ns-ping.test' -endif - -exe_splice = executable( - 'splice', - sources: 'splice.c', - dependencies: deps_common, - implicit_include_directories: false, - include_directories: inc_conf, - build_by_default: false, -) - -env = environment() -env.set('TINC_PATH', exe_tinc.full_path()) -env.set('TINCD_PATH', exe_tincd.full_path()) -env.set('SPTPS_TEST_PATH', exe_sptps_test.full_path()) -env.set('SPTPS_KEYPAIR_PATH', exe_sptps_keypair.full_path()) -env.set('SPLICE_PATH', exe_splice.full_path()) -env.set('TESTLIB_PATH', src_root / 'test' / 'testlib.sh') - -deps_test = [ - exe_tinc, - exe_tincd, - exe_splice, - exe_sptps_test, - exe_sptps_keypair, -] - -test_wd = meson.current_build_dir() - -foreach test_name : tests - target = find_program(test_name, native: true) - test(test_name, - target, - timeout: 5 * 60, - env: env, - depends: deps_test, - workdir: test_wd) -endforeach +subdir('integration') -- 2.20.1