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