mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-07-26 19:47:17 +00:00
af1612a85b
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>
27 lines
609 B
Bash
27 lines
609 B
Bash
#!/bin/sh
|
|
|
|
echo "############ Running Wolfssl Ptest ##########"
|
|
|
|
log_file=ptest.log
|
|
temp_dir=$(mktemp -d /tmp/wolfss_temp.XXXXXX)
|
|
echo "Wolfssl ptest logs are stored in ${temp_dir}/${log_file}"
|
|
|
|
./test/unit.test > "$temp_dir/$log_file" 2>&1
|
|
|
|
ret=$?
|
|
|
|
echo "Test script returned: $ret"
|
|
|
|
MAGIC_SENTENCE=$(grep "unit_test: Success for all configured tests." $temp_dir/$log_file)
|
|
|
|
if [ -n "$MAGIC_SENTENCE" ]; then
|
|
echo "$MAGIC_SENTENCE"
|
|
echo "PASS: Wolfssl"
|
|
else
|
|
echo "#### Issue with at least one test !####"
|
|
echo "FAIL: Wolfssl"
|
|
fi
|
|
NUM_FAILS=$(grep -c "Failed" $temp_dir/$log_file)
|
|
|
|
exit $ret
|