File tree Expand file tree Collapse file tree 2 files changed +31
-7
lines changed
Expand file tree Collapse file tree 2 files changed +31
-7
lines changed Original file line number Diff line number Diff line change 6060 - run : ./run-upstream-testsuite.sh release || true
6161 env :
6262 TERM : xterm
63+ - uses : actions/upload-artifact@v4
64+ with :
65+ name : test-results.json
66+ path : test-results.json
6367
6468 coverage :
6569 name : Code Coverage
Original file line number Diff line number Diff line change 4343fi
4444echo " Running $( echo " $tests " | wc -w) tests"
4545export LC_ALL=C
46- pass=" $( tput setaf 2) PASS$( tput sgr0) "
47- fail=" $( tput setaf 1) FAIL$( tput sgr0) "
48- skip=SKIP
46+ export KEEP=yes
4947exitcode=0
48+ json=" "
5049for test in $tests
5150do
52- result=$fail
51+ result=" FAIL "
5352 # Run only the tests that invoke `diff`, because other binaries aren't implemented yet
5453 if ! grep -E -s -q " (cmp|diff3|sdiff)" " $test "
5554 then
56- sh " $test " & > /dev/null && result=$pass || exitcode=1
55+ sh " $test " & > /dev/null && result=" PASS" || exitcode=1
56+ json=" $json {\" test\" :\" $test \" ,\" result\" :\" $result \" ,\" files\" :{"
57+ cd gt-$test .*
58+ for file in *
59+ do
60+ if [[ -f " $file " ]]
61+ then
62+ content=$( base64 -w0 < " $file " )
63+ json=" $json \" $file \" :\" $content \" ,"
64+ fi
65+ done
66+ json=" ${json% ,} }},"
67+ cd - > /dev/null
5768 else
58- result=$skip
69+ result=" SKIP"
70+ json=" $json {\" test\" :\" $test \" ,\" result\" :\" $result \" },"
5971 fi
60- printf " %-40s $result \n" " $test "
72+ color=2 # green
73+ [[ " $result " = " FAIL" ]] && color=1 # red
74+ [[ " $result " = " SKIP" ]] && color=3 # yellow
75+ printf " %-40s $( tput setaf $color ) $result $( tput sgr0) \n" " $test "
6176done
77+ json=" [${json% ,} ]"
6278
6379# Clean up
6480cd " $scriptpath "
6581rm -rf " $tempdir "
6682
83+ resultsfile=" test-results.json"
84+ echo " $json " | jq > " $resultsfile "
85+ echo " Results written to $resultsfile "
86+
6787exit $exitcode
You can’t perform that action at this time.
0 commit comments