Skip to contentSkip to conversation

app/test: prevent exiting after skipped test

PATCH Applied Bruce Richardson 3 participants 3 messages Dec 14, 2023 – Feb 1, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/test: prevent exiting after skipped test

When processing a list of tests to run, the loop termination condition was a test returning a value != 0. This means that if one of a series of tests was skipped, i.e. returned TEST_SKIPPED, the whole execution run was stopped. Since a test being skipped is not an error condition, we put in an explicit check for that to keep executing any remaining tests.

---
 app/test/test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test/test.c +1 -1
index c818fda17b..8b25615913 100644
@@ -235,7 +235,7 @@ main(int argc, char **argv)
 				ret = last_test_result;
 
 end_of_cmd:
-			if (ret != 0)
+			if (ret != 0 && ret != TEST_SKIPPED)
 				break;
 		}
 		if (n_skip_tests > 0)
Signature · 1 line
2.40.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Bruce Richardson

When processing a list of tests to run, the loop termination condition was a test returning a value != 0. This means that if one of a series of tests was skipped, i.e. returned TEST_SKIPPED, the whole execution run was stopped. Since a test being skipped is not an error condition, we put in an explicit check for that to keep executing any remaining tests.

---

#2 lore raw
Quoted 10 lines · Tyler Retzlaff
Quoted 7 lines · Bruce Richardson

When processing a list of tests to run, the loop termination condition was a test returning a value != 0. This means that if one of a series of tests was skipped, i.e. returned TEST_SKIPPED, the whole execution run was stopped. Since a test being skipped is not an error condition, we put in an explicit check for that to keep executing any remaining tests.

Applied, thanks.

Signature · 1 line
David Marchand