]> granicus.if.org Git - re2c/commitdiff
run_tests.sh (with '--skeleton'): clarified message, use generic CC rathen than ...
authorUlya Trofimovich <skvadrik@gmail.com>
Tue, 1 Dec 2015 12:10:49 +0000 (12:10 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Tue, 1 Dec 2015 12:10:49 +0000 (12:10 +0000)
re2c/configure.ac
re2c/run_tests.sh.in

index 132d9bf856698e7839d1600fca7a6b1c40f12c14..9787805a71958adf4271ba7db8b308b55d9c129e 100644 (file)
@@ -27,6 +27,7 @@ AM_COND_IF([REBUILD_DOCS], [
 
 # checks for programs
 AC_PATH_PROG(BISON, bison, no)
+AC_PROG_CC # used in skeleton tests
 AC_PROG_CXX
 AC_PROG_INSTALL
 
index 66ab853a44b94fe2f02e1b241be417bf7b55a83e..42ea7ed884c804b7c1ce18bc7f9b2f48d6f3c9ec 100644 (file)
@@ -140,20 +140,25 @@ run_pack() {
                then
                        local switches="$switches --skeleton -Werror-undefined-control-flow"
 
-                       local status=""
-                       [ -z $status ] && status=`${valgrind} ${wine} ../${re2c} $switches "../$x" 2>"$outc.stderr" || echo "FAIL_RE2C"`
-                       [ -z $status ] && status=`gcc -Wall -Wextra -o "$outc.out" "$outc" 2>>"$outc.stderr" || echo "FAIL_CC"`
-                       [ -z $status ] && status=`./"$outc.out" 2>>"$outc.stderr" || echo "FAIL_RUN"`
-                       [ -z $status ] && status="OK"
-                       if [ $status = "OK" -o $status = "FAIL_RE2C" ]
-                       then
+                       local status=0
+                       ${valgrind} ${wine} ../${re2c} $switches "../$x" 2>"$outc.stderr" || status=1
+                       [ $status -eq 0 ] && { @CC@ -Wall -Wextra -o "$outc.out" "$outc" 2>>"$outc.stderr" || status=2; }
+                       [ $status -eq 0 ] && { ./"$outc.out" 2>>"$outc.stderr" || status=3; }
+
+                       case $status in
+                               0 ) local msg="OK" ;;
+                               1 ) local msg="OK (expected re2c error)" ;;
+                               2 ) local msg="FAIL (compilation error)" ;;
+                               3 ) local msg="FAIL (runtime error)" ;;
+                       esac
+                       printf "%-25s $outx\n" "$msg"
+
+                       if [ $status -le 1 ]; then
                                [ $keep_tmp_files -eq 0 ] && rm -f "$outc"{,.line*.{input,keys},.stderr,.out}
                        else
                                cp -f "../$x" "$outx"
                                local errcnt=$(($errcnt + 1))
                        fi
-
-                       printf "%-10s $outx\n" "$status"
                else
                        # create sandbox
                        tmpdir="tmp_$log" \