@@ -76,7 +76,6 @@ total=$(echo "$tests" | wc -w)
7676echo " Running $total tests"
7777export LC_ALL=C
7878export KEEP=yes
79- exitcode=0
8079timestamp=$( date -Iseconds)
8180urlroot=" $gitserver /cgit/diffutils.git/tree/tests/"
8281passed=0
9190 # because other binaries aren't implemented yet
9291 if ! grep -E -s -q " (diff3|sdiff)" " $test "
9392 then
94- sh " $test " 1> stdout.txt 2> stderr.txt && result=" PASS" || exitcode=1
95- json+=" {\" test\" :\" $test \" ,\" result\" :\" $result \" ,"
96- json+=" \" url\" :\" $url \" ,"
97- json+=" \" stdout\" :\" $( base64 -w0 < stdout.txt) \" ,"
98- json+=" \" stderr\" :\" $( base64 -w0 < stderr.txt) \" ,"
99- json+=" \" files\" :{"
100- cd gt-$test .*
101- # Note: this doesn't include the contents of subdirectories,
102- # but there isn't much value added in doing so
103- for file in *
104- do
105- [[ -f " $file " ]] && json+=" \" $file \" :\" $( base64 -w0 < " $file " ) \" ,"
106- done
107- json=" ${json% ,} }},"
108- cd - > /dev/null
109- [[ " $result " = " PASS" ]] && (( passed++ ))
110- [[ " $result " = " FAIL" ]] && (( failed++ ))
93+ sh " $test " 1> stdout.txt 2> stderr.txt && result=" PASS"
94+ if [[ $? = 77 ]]
95+ then
96+ result=" SKIP"
97+ else
98+ json+=" {\" test\" :\" $test \" ,\" result\" :\" $result \" ,"
99+ json+=" \" url\" :\" $url \" ,"
100+ json+=" \" stdout\" :\" $( base64 -w0 < stdout.txt) \" ,"
101+ json+=" \" stderr\" :\" $( base64 -w0 < stderr.txt) \" ,"
102+ json+=" \" files\" :{"
103+ cd gt-$test .*
104+ # Note: this doesn't include the contents of subdirectories,
105+ # but there isn't much value added in doing so
106+ for file in *
107+ do
108+ [[ -f " $file " ]] && json+=" \" $file \" :\" $( base64 -w0 < " $file " ) \" ,"
109+ done
110+ json=" ${json% ,} }},"
111+ cd - > /dev/null
112+ [[ " $result " = " PASS" ]] && (( passed++ ))
113+ [[ " $result " = " FAIL" ]] && (( failed++ ))
114+ fi
111115 else
112116 result=" SKIP"
113- (( skipped++ ))
114- json+=" {\" test\" :\" $test \" ,\" url\" :\" $url \" ,\" result\" :\" $result \" },"
115117 fi
116118 color=2 # green
117119 [[ " $result " = " FAIL" ]] && color=1 # red
118- [[ " $result " = " SKIP" ]] && color=3 # yellow
120+ if [[ $result = " SKIP" ]]
121+ then
122+ (( skipped++ ))
123+ json+=" {\" test\" :\" $test \" ,\" url\" :\" $url \" ,\" result\" :\" $result \" },"
124+ color=3 # yellow
125+ fi
119126 printf " %-40s $( tput setaf $color ) $result $( tput sgr0) \n" " $test "
120127done
121128echo " "
@@ -143,4 +150,5 @@ resultsfile="test-results.json"
143150echo " $json " | jq > " $resultsfile "
144151echo " Results written to $scriptpath /$resultsfile "
145152
146- exit $exitcode
153+ (( failed > 0 )) && exit 1
154+ exit 0
0 commit comments