33set -e
44
55if [ $# -lt 2 ]; then
6- echo " Usage: $0 <build_result> < test_result> [WOLFPROV_FORCE_FAIL] [TEST_SUITE]"
6+ echo " Usage: $0 <test_result> [WOLFPROV_FORCE_FAIL] [TEST_SUITE]"
77 exit 1
88fi
99
10- BUILD_RESULT=" $1 "
11- TEST_RESULT=" $2 "
12- WOLFPROV_FORCE_FAIL=" ${3:- } "
13- TEST_SUITE=" ${4:- } "
10+ TEST_RESULT=" $1 "
11+ WOLFPROV_FORCE_FAIL=" ${2:- } "
12+ TEST_SUITE=" ${3:- } "
1413
1514if [ " $WOLFPROV_FORCE_FAIL " = " 1" ]; then
1615 if [ " $TEST_SUITE " = " curl" ]; then
@@ -74,7 +73,7 @@ if [ "$WOLFPROV_FORCE_FAIL" = "1" ]; then
7473 # --- simple test suite specific logic ---
7574 if [ -f " test-suite.log" ]; then
7675 # For simple tests, we expect all tests to fail when force fail is enabled
77- if [ $BUILD_RESULT -eq 0 ] || [ $ TEST_RESULT -eq 0 ]; then
76+ if [ $TEST_RESULT -eq 0 ]; then
7877 echo " Simple tests unexpectedly succeeded with force fail enabled"
7978 exit 1
8079 else
@@ -87,20 +86,16 @@ if [ "$WOLFPROV_FORCE_FAIL" = "1" ]; then
8786 fi
8887 else
8988 # --- generic force-fail logic for other suites ---
90- if [ $BUILD_RESULT -eq 0 ] || [ $ TEST_RESULT -eq 0 ]; then
91- echo " Build/ Test unexpectedly succeeded with force fail enabled"
89+ if [ $TEST_RESULT -eq 0 ]; then
90+ echo " Test unexpectedly succeeded with force fail enabled"
9291 exit 1 # failure was not seen when expected
9392 else
94- echo " Build/ Test failed as expected with force fail enabled"
93+ echo " Test failed as expected with force fail enabled"
9594 exit 0 # expected failure occurred
9695 fi
9796 fi
98- elif [ $BUILD_RESULT -ne 0 ] || [ $TEST_RESULT -ne 0 ]; then
99- if [ $BUILD_RESULT -eq 2 ]; then
100- echo " Build/test setup failed unexpectedly"
101- else
102- echo " Tests failed unexpectedly"
103- fi
97+ elif [ $TEST_RESULT -ne 0 ]; then
98+ echo " Tests failed unexpectedly"
10499 exit 1
105100else
106101 echo " Tests passed successfully"
0 commit comments