app/test: prevent exiting after skipped test

Message ID 20231214113813.574758-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series app/test: prevent exiting after skipped test |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Bruce Richardson Dec. 14, 2023, 11:38 a.m. UTC
  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.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Tyler Retzlaff Dec. 14, 2023, 5:03 p.m. UTC | #1
On Thu, Dec 14, 2023 at 11:38:13AM +0000, Bruce Richardson wrote:
> 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.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
  
David Marchand Feb. 1, 2024, 10:34 a.m. UTC | #2
On Thu, Dec 14, 2023 at 6:04 PM Tyler Retzlaff
<roretzla@linux.microsoft.com> wrote:
>
> On Thu, Dec 14, 2023 at 11:38:13AM +0000, Bruce Richardson wrote:
> > 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.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>

Applied, thanks.
  

Patch

diff --git a/app/test/test.c b/app/test/test.c
index c818fda17b..8b25615913 100644
--- a/app/test/test.c
+++ b/app/test/test.c
@@ -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)