File tree 2 files changed +31
-7
lines changed
2 files changed +31
-7
lines changed Original file line number Diff line number Diff line change 60
60
- run : ./run-upstream-testsuite.sh release || true
61
61
env :
62
62
TERM : xterm
63
+ - uses : actions/upload-artifact@v4
64
+ with :
65
+ name : test-results.json
66
+ path : test-results.json
63
67
64
68
coverage :
65
69
name : Code Coverage
Original file line number Diff line number Diff line change 43
43
fi
44
44
echo " Running $( echo " $tests " | wc -w) tests"
45
45
export 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
49
47
exitcode=0
48
+ json=" "
50
49
for test in $tests
51
50
do
52
- result=$fail
51
+ result=" FAIL "
53
52
# Run only the tests that invoke `diff`, because other binaries aren't implemented yet
54
53
if ! grep -E -s -q " (cmp|diff3|sdiff)" " $test "
55
54
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
57
68
else
58
- result=$skip
69
+ result=" SKIP"
70
+ json=" $json {\" test\" :\" $test \" ,\" result\" :\" $result \" },"
59
71
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 "
61
76
done
77
+ json=" [${json% ,} ]"
62
78
63
79
# Clean up
64
80
cd " $scriptpath "
65
81
rm -rf " $tempdir "
66
82
83
+ resultsfile=" test-results.json"
84
+ echo " $json " | jq > " $resultsfile "
85
+ echo " Results written to $resultsfile "
86
+
67
87
exit $exitcode
You can’t perform that action at this time.
0 commit comments