]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
meson: tests/config - run simple config tests
authorTomas Krizek <tomas.krizek@nic.cz>
Thu, 31 Jan 2019 14:36:24 +0000 (15:36 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 12 Mar 2019 09:41:53 +0000 (10:41 +0100)
tests/config/meson.build [new file with mode: 0644]
tests/meson.build

diff --git a/tests/config/meson.build b/tests/config/meson.build
new file mode 100644 (file)
index 0000000..c04488c
--- /dev/null
@@ -0,0 +1,49 @@
+config_tests = [
+  ['basic', files('basic.test.lua')],
+  ['cache', files('cache.test.lua')],
+  ['lru', files('lru.test.lua')],
+  ['tls', files('tls.test.lua')],
+]
+
+if get_option('daemon')
+  foreach config_test : config_tests
+    conftest_dir = join_paths(meson.current_build_dir(), config_test[0])
+
+    testdir_clean = custom_target(
+      'config.' + config_test[0] + ': clean testdir',
+      command: [
+       'rm', '-r', '-f', conftest_dir,
+      ],
+      output: config_test[0] + '.rm',
+      build_by_default: false,
+    )
+
+    testdir_create = custom_target(
+      'config.' + config_test[0] + ': create testdir',
+      command: [
+       'mkdir', conftest_dir,
+      ],
+      depends: testdir_clean,
+      output: config_test[0],
+      build_always_stale: true,  # make sure to always recreate dir
+      build_by_default: false,
+    )
+
+    test(
+      'config.' + config_test[0],
+      kresd,
+      args: [
+       '-c', files('test.cfg'),
+       '-f', '1',
+      ],
+      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]),
+      ],
+      suite: 'config',
+      workdir: join_paths(meson.current_build_dir(), config_test[0]),
+      depends: testdir_create,
+    )
+  endforeach
+endif
index 082b746f604e167b0e60e1a38e185d165ad14605..08ccb01adf684d2d4ee08f33c07d92eeeb729eca 100644 (file)
@@ -1 +1,2 @@
+subdir('config')
 subdir('unit')