]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
ptest-perl/run-ptest: set exit code
authorGyorgy Sarvari <skandigraun@gmail.com>
Sat, 25 Oct 2025 14:52:11 +0000 (16:52 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 27 Oct 2025 16:58:15 +0000 (16:58 +0000)
Set exit code on the run-ptest script: though the logparser
looks for PASS/FAIL state, it can be still useful when running
the tests manually - when there is a lot of output, it is
easier to see the summary at the end if the test has actually
passed or failed without scrolling back.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/files/ptest-perl/run-ptest

index fd35357b42bf617be8b44411e174d6cd4e97003b..51e467abe7b9a1dc2e48e66020afe6de0e885d56 100644 (file)
@@ -1,10 +1,12 @@
 #!/bin/sh
 
+result=0
 for case in `find t -type f -name '*.t'`; do
     perl -I . $case >$case.output 2>&1
     ret=$?
     cat $case.output
     if [ $ret -ne 0 ]; then
+        result=1
         echo "FAIL: ${case%.t}"
     elif grep -i 'SKIP' $case.output; then
         echo "SKIP: ${case%.t}"
@@ -14,3 +16,5 @@ for case in `find t -type f -name '*.t'`; do
 
     rm -f $case.output
 done
+
+exit $result