]> granicus.if.org Git - re2c/commitdiff
run_tests.sh: paste type headers into source file and diff all at once.
authorUlya Trofimovich <skvadrik@gmail.com>
Wed, 14 Oct 2015 13:19:55 +0000 (14:19 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Wed, 14 Oct 2015 13:19:55 +0000 (14:19 +0100)
re2c/run_tests.sh.in
re2c/test/condition_05.cgitcondition_05.cgit.h.c
re2c/test/condition_05.cgitcondition_05.cgit.h.h [deleted file]
re2c/test/condition_05.cgtcondition_05.cgt.h.c
re2c/test/condition_05.cgtcondition_05.cgt.h.h [deleted file]
re2c/test/condtype.cgtcondtype.cg.h.c
re2c/test/condtype.cgtcondtype.cg.h.h [deleted file]
re2c/test/condtype.cstcondtype.cs.h.c
re2c/test/condtype.cstcondtype.cs.h.h [deleted file]
re2c/test/condtype.ctcondtype.c.h.c
re2c/test/condtype.ctcondtype.c.h.h [deleted file]

index bc26d6ac848ba38b27d0d1c108c79eab0799c6ee..b23b1c93b1cdf31119475694366d6e39094c0acc 100644 (file)
@@ -112,12 +112,10 @@ run_pack() {
                fi
                local outname=${outx%.re}.c.temp
                local outdiff=${outx%.re}.c.diff
-               local typname=${outx%.re}.h.temp
-               local typdiff=${outx%.re}.h.diff
                local outc="${outx%.re}.c"
 
                local switches=`basename $x | sed -e 's/^[^.]*\.\(.*\)\.re$/-\1/g' -e 's/^[^-].*//g' -e 's/\([^ ]\)--/\1 --/g' -e 's/(\([^)]*\))/ \1/g' -e 's/- //g'`
-               local headers=` printf "%s" "$switches" | grep -e '^-[^t -]*t[^ -]\+' | sed -e 's,^-[^t -]*t\([^ -]\+\),'"$test_blddir"'/\1,g'`
+               local outh=` printf "%s" "$switches" | grep -e '^-[^t -]*t[^ -]\+' | sed -e 's,^-[^t -]*t\([^ -]\+\),'"$test_blddir"'/\1,g'`
                local switches=`printf "%s" "$switches" | sed -e 's,^-\([^ot-]*[ot]\)\(.*\)$,-\1'"$test_blddir"'/\2,g'`
                local switches="$switches -o $outc"
                # enable warnings globally
@@ -149,16 +147,19 @@ run_pack() {
                        $cmd 2>$outname_stderr
                        cat $outname_stderr $outc > $outname
                        rm $outname_stderr $outc
-                       # don't forget '--skeleton' files
+                       # don't forget '-S, --skeleton' files
                        for f in `find $(dirname $outc) -type f -name "$(basename $outc).line*.input"`
                        do
                                cat $f ${f%.input}.keys >> $outname
                                rm $f ${f%.input}.keys
                        done
+                       # don't forget '-t, --type-header' files
+                       [ -n "$outh" ] && cat "$outh" >> $outname && rm "$outh"
 
                        LC_ALL=C sed -i $outname \
                                -e "s,$x,`basename $x`,g" \
                                -e "s,$outc,<stdout>,g" \
+                               -e "s,$outh,`[ -z $outh ] || basename $outh`,g" \
                                -e 's,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g'
 
                        if test ! -f ${x%.re}.c
@@ -179,30 +180,7 @@ run_pack() {
                                        cp -f ${x%.re}.c ${outx%.re}.c
                                fi
                        fi
-
-                       if test -n "$headers"
-                       then
-                               cat $headers | sed -e 's,'"$test_blddir"'/,,g' -e 's,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g' > $typname
-                               rm $headers
-                               if test ! -f ${x%.re}.h
-                               then
-                                       echo "FAIL missing ${x%.re}.h"
-                                       local errcnt=$(($errcnt + 1))
-                                       cp -f $x $outx
-                               elif $diff_prog ${x%.re}.h $typname > $typdiff
-                               then
-                                       echo "OK $x: $switches"
-                                       rm $typname
-                               else
-                                       echo "FAIL $x: $switches"
-                                       local errcnt=$(($errcnt + 1))
-                                       cp -f $x $outx
-                                       cp -f ${x%.re}.h ${outx%.re}.h
-                               fi
-                       fi
                        test -f $outdiff -a ! -s $outdiff && rm -f $outdiff
-                       test -f $typdiff -a ! -s $typdiff && rm -f $typdiff
-
                fi
        done
        echo $errcnt > $log
index 290ec32a87902676e9e83418fc5e56990e52908a..6a7bde3f92bd0863a18ab2337d2ebfa3c9609d16 100644 (file)
@@ -136,3 +136,9 @@ int main(int argc, char **argv)
        }
        return 0;
 }
+/* Generated by re2c */
+
+enum YYCONDTYPE {
+       yycnormal,
+       yyccomment,
+};
diff --git a/re2c/test/condition_05.cgitcondition_05.cgit.h.h b/re2c/test/condition_05.cgitcondition_05.cgit.h.h
deleted file mode 100644 (file)
index 439fa96..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Generated by re2c */
-
-enum YYCONDTYPE {
-       yycnormal,
-       yyccomment,
-};
index 9e08070b7f75e607a6b000b8bb47cca26feeb7e3..569f71c1fb0fc8d8b7881e2de4610a0590aef5b0 100644 (file)
@@ -147,3 +147,10 @@ int main(int argc, char **argv)
        }
        return 0;
 }
+/* Generated by re2c */
+#line 3 "condition_05.cgt.h"
+
+enum YYCONDTYPE {
+       yycnormal,
+       yyccomment,
+};
diff --git a/re2c/test/condition_05.cgtcondition_05.cgt.h.h b/re2c/test/condition_05.cgtcondition_05.cgt.h.h
deleted file mode 100644 (file)
index dbd252f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Generated by re2c */
-#line 3 "condition_05.cgt.h"
-
-enum YYCONDTYPE {
-       yycnormal,
-       yyccomment,
-};
index 8b714e15a5bec98a61a588786f3a78c918234fe2..427c7cf8d22f5b94cef64a6ba24793876bfb9072 100644 (file)
@@ -39,3 +39,10 @@ yy9:
 
        return 0;
 }
+/* Generated by re2c */
+#line 3 "condtype.cg.h"
+
+enum YYCONDTYPE {
+       yyca,
+       yycb,
+};
diff --git a/re2c/test/condtype.cgtcondtype.cg.h.h b/re2c/test/condtype.cgtcondtype.cg.h.h
deleted file mode 100644 (file)
index 2968e38..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Generated by re2c */
-#line 3 "condtype.cg.h"
-
-enum YYCONDTYPE {
-       yyca,
-       yycb,
-};
index c84d1087181c743e564592cd14bac08e78f209b8..f2b7795d1678e1e022272ff8dbd1fe257b1a3d93 100644 (file)
@@ -39,3 +39,10 @@ yy9:
 
        return 0;
 }
+/* Generated by re2c */
+#line 3 "condtype.cs.h"
+
+enum YYCONDTYPE {
+       yyca,
+       yycb,
+};
diff --git a/re2c/test/condtype.cstcondtype.cs.h.h b/re2c/test/condtype.cstcondtype.cs.h.h
deleted file mode 100644 (file)
index 200c172..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Generated by re2c */
-#line 3 "condtype.cs.h"
-
-enum YYCONDTYPE {
-       yyca,
-       yycb,
-};
index e6fbd57a97d3cb9d254fbc5b8bf58908bddc4038..c4bb7e0c15b0fa1ed397cad8ace69d626b604e02 100644 (file)
@@ -46,3 +46,10 @@ yy9:
 
        return 0;
 }
+/* Generated by re2c */
+#line 3 "condtype.c.h"
+
+enum YYCONDTYPE {
+       yyca,
+       yycb,
+};
diff --git a/re2c/test/condtype.ctcondtype.c.h.h b/re2c/test/condtype.ctcondtype.c.h.h
deleted file mode 100644 (file)
index 691d86d..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Generated by re2c */
-#line 3 "condtype.c.h"
-
-enum YYCONDTYPE {
-       yyca,
-       yycb,
-};