diff options
Diffstat (limited to 'test/runtests.in')
-rwxr-xr-x | test/runtests.in | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/test/runtests.in b/test/runtests.in index d331f77..8eb91ed 100755 --- a/test/runtests.in +++ b/test/runtests.in @@ -18,9 +18,10 @@ # # You should have received a copy of the GNU General Public License # along with Ragel; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +TEST_LOG="/tmp/ragel_test" -while getopts "gcnmleT:F:G:P:CDJRA" opt; do +while getopts "gcnmleT:F:G:P:CDJRAZ" opt; do case $opt in T|F|G|P) genflags="$genflags -$opt$OPTARG" @@ -37,7 +38,7 @@ while getopts "gcnmleT:F:G:P:CDJRA" opt; do g) allow_generated="true" ;; - C|D|J|R|A) + C|D|J|R|A|Z) langflags="$langflags -$opt" ;; esac @@ -45,13 +46,13 @@ done [ -z "$minflags" ] && minflags="-n -m -l -e" [ -z "$genflags" ] && genflags="-T0 -T1 -F0 -F1 -G0 -G1 -G2" -[ -z "$langflags" ] && langflags="-C -D -J -R -A" +[ -z "$langflags" ] && langflags="-C -D -J -R -A -Z" shift $((OPTIND - 1)); [ -z "$*" ] && set -- *.rl -config=../ragel/config.h +config=../src/config.h ragel=../ragel/ragel cxx_compiler="@CXX@" @@ -62,6 +63,7 @@ java_compiler="@JAVAC@" txl_engine="@TXL@" ruby_engine="@RUBY@" csharp_compiler="@GMCS@" +go_compiler="@GOBIN@" function test_error { @@ -124,9 +126,10 @@ function run_test() $exec_cmd 2>&1 > $output; if diff --strip-trailing-cr $expected_out $output > /dev/null; then echo "passed"; + echo "TEST: PASS: $root" >> $TEST_LOG; else - echo "FAILED"; - test_error; + echo "FAILED"; + echo "TEST: FAIL: $root" >> $TEST_LOG; fi; fi } @@ -203,18 +206,25 @@ for test_case; do compiler=$csharp_compiler cflags="" ;; + go) + lang_opt="-Z" + code_suffix=go + compiler=$go_compiler + cflags="" + ;; indep) lang_opt=""; # If we have no txl engine then skip this test. [ -z "$txl_engine" ] && continue - for lang in c d java ruby csharp; do + for lang in c d java ruby csharp go; do case $lang in c) lf="-C";; d) lf="-D";; java) lf="-J";; ruby) lf="-R";; csharp) lf="-A";; + go) lf="-Z";; esac echo "$langflags" | grep -e $lf >/dev/null || continue @@ -308,6 +318,20 @@ for test_case; do done done ;; - esac + go) + # Using genflags, get the allowed gen flags from the test case. If the + # test case doesn't specify assume that all gen flags are allowed. + allow_genflags=`sed '/@ALLOW_GENFLAGS:/s/^.*: *//p;d' $test_case` + [ -z "$allow_genflags" ] && allow_genflags="-T0 -T1 -F0 -F1 -G0 -G1 -G2" + + for min_opt in $minflags; do + echo "$allow_minflags" | grep -e $min_opt >/dev/null || continue + for gen_opt in $genflags; do + echo "$allow_genflags" | grep -e $gen_opt >/dev/null || continue + run_test + done + done + ;; + esac done |