]> git.mdlowis.com Git - proto/labwc.git/commitdiff
tests/meson.build: refactor with foreach
authorJohan Malm <jgm323@gmail.com>
Wed, 10 Jun 2020 15:46:36 +0000 (16:46 +0100)
committerJohan Malm <jgm323@gmail.com>
Wed, 10 Jun 2020 15:46:36 +0000 (16:46 +0100)
tests/meson.build

index f0b9c89f2e15eb23ef9f887add8054f3c42afe24..e128600ba222ffb79ec1aa804cf3ff6f599e96d3 100644 (file)
@@ -6,18 +6,19 @@ rcxml_lib = static_library(
   link_with: library('libxml-2.0'),
 )
 
-t1000 = executable(
-  't1000-rcxml-simple-parse',
-  sources: ['t1000-rcxml-simple-parse.c', 'tap.c'],
-  include_directories: [labwc_inc],
-  link_with: rcxml_lib,
-)
-test('t1000', t1000)
+rcxml_tests = [
+  't1000-rcxml-simple-parse.c',
+  't1001-rcxml-nodenames-simple.c',
+]
+
+foreach t : rcxml_tests
+  testname = t.split('.')[0].underscorify()
+  exe = executable(
+    testname,
+    sources: [t, 'tap.c'],
+    include_directories: [labwc_inc],
+    link_with: rcxml_lib,
+  )
+  test(testname, exe)
+endforeach
 
-t1001 = executable(
-  't1001-rcxml-nodenames-simple',
-  sources: ['t1001-rcxml-nodenames-simple.c', 'tap.c'],
-  include_directories: [labwc_inc],
-  link_with: rcxml_lib,
-)
-test('t1001', t1001)