diff mbox series

[BlueZ,2/5] shared/tester: retain test failure status

Message ID f490bf6fe5b7d3610b26b2fc005440c8bcd8933d.1684682575.git.pav@iki.fi (mailing list archive)
State Accepted
Commit 195b9abbae0e0a17e9f8217c67f7c12ccefa521a
Headers show
Series [BlueZ,1/5] iso-tester: always use DEFER_SETUP for multiple CIS in same CIG | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

Pauli Virtanen May 21, 2023, 3:27 p.m. UTC
If a test has called tester_test_failed, consider the test failed, even
if the test also called tester_test_passed/abort.

This avoids reporting success for misbehaving tests that call the
status report functions multiple times.
---
 src/shared/tester.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/src/shared/tester.c b/src/shared/tester.c
index 34f807556..a1ee5b687 100644
--- a/src/shared/tester.c
+++ b/src/shared/tester.c
@@ -622,6 +622,9 @@  static void test_result(enum test_result result)
 		test->timeout_id = 0;
 	}
 
+	if (test->result == TEST_RESULT_FAILED)
+		result = TEST_RESULT_FAILED;
+
 	test->result = result;
 	switch (result) {
 	case TEST_RESULT_PASSED: