summaryrefslogtreecommitdiff
path: root/test/meson.build
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-01-19 03:21:15 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-01-25 02:39:15 +0200
commit4f76beae8612f02e086e96d79447b7e8984c8821 (patch)
tree2efa84b78cf84898f9d593c32641075a6038dfb0 /test/meson.build
parentdfe81fd702c96bfb3f7c5c46f1493d54dfcd1798 (diff)
test: timer-thread: Move timer start from wrong thread to separate test
Starting a timer from the wrong thread is expected to fail, and we test this in the timer-thread unit test. This is however not something that a caller is allowed to do, and libcamera will get assertion failures to catch this invalid usage. The unit test will then fail. To prepare for this, split the unit test in two, with a test that is expected by meson to succeed, and one that is expected to fail. The assertion will then cause an expected failure, making the test suite succeed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Diffstat (limited to 'test/meson.build')
-rw-r--r--test/meson.build9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/meson.build b/test/meson.build
index 189e1428..8b6057d4 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -69,6 +69,7 @@ internal_tests = [
{'name': 'signal-threads', 'sources': ['signal-threads.cpp']},
{'name': 'threads', 'sources': 'threads.cpp', 'dependencies': [libthreads]},
{'name': 'timer', 'sources': ['timer.cpp']},
+ {'name': 'timer-fail', 'sources': ['timer-fail.cpp'], 'should_fail': true},
{'name': 'timer-thread', 'sources': ['timer-thread.cpp']},
{'name': 'unique-fd', 'sources': ['unique-fd.cpp']},
{'name': 'utils', 'sources': ['utils.cpp']},
@@ -91,7 +92,7 @@ foreach test : public_tests
link_with : test_libraries,
include_directories : test_includes_public)
- test(test['name'], exe)
+ test(test['name'], exe, should_fail : test.get('should_fail', false))
endforeach
foreach test : internal_tests
@@ -105,7 +106,7 @@ foreach test : internal_tests
link_with : test_libraries,
include_directories : test_includes_internal)
- test(test['name'], exe)
+ test(test['name'], exe, should_fail : test.get('should_fail', false))
endforeach
foreach test : internal_non_parallel_tests
@@ -119,5 +120,7 @@ foreach test : internal_non_parallel_tests
link_with : test_libraries,
include_directories : test_includes_internal)
- test(test['name'], exe, is_parallel : false)
+ test(test['name'], exe,
+ is_parallel : false,
+ should_fail : test.get('should_fail', false))
endforeach