[tracker-miners/functional-tests-depends-checks: 3/4] tests: Use meson test suites to group tests



commit 4a20931cef922d7c5723c3cef9f9aa814d31e61d
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Fri Aug 23 01:13:51 2019 +0300

    tests: Use meson test suites to group tests
    
    Instead of using old-style separators for tests, use native meson suites.
    
    So we can optionally just run (or not) one test suite.

 tests/functional-tests/meson.build         | 13 +++++++++++--
 tests/libtracker-extract/meson.build       |  5 ++---
 tests/libtracker-miners-common/meson.build |  3 +--
 3 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/tests/functional-tests/meson.build b/tests/functional-tests/meson.build
index 613db7b85..2f5a07a5f 100644
--- a/tests/functional-tests/meson.build
+++ b/tests/functional-tests/meson.build
@@ -141,14 +141,23 @@ test_env.set('TRACKER_TESTS_VERBOSE', '1')
 
 foreach t: extractor_tests
   data = join_paths('test-extraction-data', t) + '.expected.json'
-  test('functional/extract/' + t, test_runner,
+  test_name = t
+  test_parts = t.split('/')
+  test_suite = []
+  if test_parts.length() == 2
+    test_name = test_parts[1]
+    test_suite = [test_parts[0]]
+  endif
+  test(test_name, test_runner,
+    suite: ['extractor'] + test_suite,
     args: ['./400-extractor-metadata.py', data],
     env: test_env,
     workdir: meson.current_source_dir())
 endforeach
 
 foreach t: functional_tests
-  test('functional-' + t, test_runner,
+  test(t, test_runner,
+    suite: ['functional'],
     args: './' + t + '.py',
     env: test_env,
     workdir: meson.current_source_dir(),
diff --git a/tests/libtracker-extract/meson.build b/tests/libtracker-extract/meson.build
index ba1b02f70..65f6da074 100644
--- a/tests/libtracker-extract/meson.build
+++ b/tests/libtracker-extract/meson.build
@@ -20,13 +20,12 @@ libtracker_extract_test_deps = [
 foreach base_name: libtracker_extract_tests
     source = 'tracker-@0@-test.c'.format(base_name)
     binary_name = 'tracker-@0@-test'.format(base_name)
-    test_name = 'extract-@0@'.format(base_name)
 
     binary = executable(binary_name, source,
       dependencies: libtracker_extract_test_deps,
       c_args: test_c_args)
 
-    test(test_name, binary)
+    test(base_name, binary, suite: 'extract')
 endforeach
 
 if libiptcdata.found() and libjpeg.found()
@@ -35,5 +34,5 @@ if libiptcdata.found() and libjpeg.found()
     dependencies: libtracker_extract_test_deps + [libjpeg],
     c_args: test_c_args,
   )
-  test('extract-iptc', iptc_test)
+  test('extract-iptc', iptc_test, suite: 'extract')
 endif
diff --git a/tests/libtracker-miners-common/meson.build b/tests/libtracker-miners-common/meson.build
index 1669a3eec..d284a66a1 100644
--- a/tests/libtracker-miners-common/meson.build
+++ b/tests/libtracker-miners-common/meson.build
@@ -14,11 +14,10 @@ libtracker_miners_common_test_deps = [
 foreach base_name: libtracker_common_tests
     source = 'tracker-@0@-test.c'.format(base_name)
     binary_name = 'tracker-@0@-test'.format(base_name)
-    test_name = 'miners-common-@0@'.format(base_name)
 
     binary = executable(binary_name, source,
       dependencies: libtracker_miners_common_test_deps,
       c_args: test_c_args)
 
-    test(test_name, binary)
+    test(base_name, binary, suite: 'miners-common')
 endforeach


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]