Message ID | 20250529151914.3835492-1-raj.khem@gmail.com |
---|---|
State | New |
Headers | show |
Series | [meta-networking] wolfssl: Use the return value from unit.test as pass/fail indicator | expand |
diff --git a/meta-networking/recipes-connectivity/wolfssl/files/run-ptest b/meta-networking/recipes-connectivity/wolfssl/files/run-ptest index ff66f4ef6c..fd260d441a 100644 --- a/meta-networking/recipes-connectivity/wolfssl/files/run-ptest +++ b/meta-networking/recipes-connectivity/wolfssl/files/run-ptest @@ -8,7 +8,9 @@ echo "Wolfssl ptest logs are stored in ${temp_dir}/${log_file}" ./test/unit.test > "$temp_dir/$log_file" 2>&1 -echo "Test script returned: $?" +ret=$? + +echo "Test script returned: $ret" MAGIC_SENTENCE=$(grep "unit_test: Success for all configured tests." $temp_dir/$log_file) @@ -21,4 +23,4 @@ else fi NUM_FAILS=$(grep -c "Failed" $temp_dir/$log_file) -exit $NUM_FAILS +exit $ret
Using a string search for Fail is not going to work always e.g. when all tests are passing it still prints a summary string with string "Fail" in it which points to 0, however the logic here catches that and counts it as 1 failure and marks the return value as 1 and ptest runner interprets that as failure Pass the return value from unit.test which should be 0 on all passes or non zero otherwise. Signed-off-by: Khem Raj <raj.khem@gmail.com> --- .../recipes-connectivity/wolfssl/files/run-ptest | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)