]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
meson: tests/config: use PATH instead of KRESD_EXEC
authorTomas Krizek <tomas.krizek@nic.cz>
Mon, 4 Feb 2019 15:43:51 +0000 (16:43 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 12 Mar 2019 09:43:21 +0000 (10:43 +0100)
daemon/meson.build
scripts/test-config.sh
tests/config/meson.build

index ac1b5f05a7895a90606b0212ed6e366729254a71..651bb1dbb460d9c93981f036171635440eb77154 100644 (file)
@@ -86,6 +86,6 @@ if get_option('daemon')
   )
 
   kresd_install_path = join_paths(
-    get_option('prefix'), get_option('sbindir'), 'kresd')
+    get_option('prefix'), get_option('sbindir'))
   message(kresd_install_path)
 endif
index 1774e14433bb21fcb8ede263a0461208b211f0d9..caeda8c197dd509224dabd1c0138a3c1dd306fef 100755 (executable)
@@ -19,7 +19,7 @@ trap finish EXIT
 cp -a "${TEST_DIR}/"* "${TMP_RUNDIR}/"
 cd "${TMP_RUNDIR}"
 
-test -x "${KRESD_EXEC}" || (echo "${KRESD_EXEC} not executable!"; exit 77)
+which kresd || (echo "kresd not executable!"; exit 77)
 trap ERR  # get actual kresd error code from now on
 
-${KRESD_EXEC} "$@"
+kresd "$@"
index 12faa3da0a9fbe945affad5156962e2ad7eaa46b..816c014dd0b7b63ffae2e1cd5507e8beae6e3104 100644 (file)
@@ -24,6 +24,13 @@ config_tests += [
 
 
 run_configtest = find_program('../../scripts/test-config.sh')
+
+# environment variables for test
+conftest_env = environment()
+conftest_env.prepend('PATH', kresd_install_path)
+conftest_env.set('KRESD_NO_LISTEN', '1')
+conftest_env.set('SOURCE_PATH', meson.current_source_dir())
+
 foreach config_test : config_tests
   # kresd arguments
   conftest_args = [
@@ -37,16 +44,13 @@ foreach config_test : config_tests
   # kresd return code check
   conftest_should_fail = config_test.length() >= 4 ? config_test[3] : false
 
+  conftest_env.set(
+    'TEST_FILE', '@0@/@1@'.format(meson.source_root(), config_test[1][0]))
   test(
     'config.' + config_test[0],
     run_configtest,
     args: conftest_args,
-    env: [
-      'KRESD_NO_LISTEN=1',
-      'SOURCE_PATH=@0@'.format(meson.current_source_dir()),
-      'TEST_FILE=@0@/@1@'.format(meson.source_root(), config_test[1][0]),
-      'KRESD_EXEC=@0@'.format(kresd_install_path),
-    ],
+    env: conftest_env,
     suite: [
       'postinstall',
       'config',