3 # Run the reference lexer against libsyntax and compare the tokens and spans.
4 # If "// ignore-lexer-test" is present in the file, it will be ignored.
7 # Argument $1 is the file to check, $2 is the classpath to use, $3 is the path
8 # to the grun binary, $4 is the path to the verify binary, $5 is the path to
10 if [ "${VERBOSE}" == "1" ]; then
19 grep --silent "// ignore-lexer-test" $1;
21 # if it's *not* found...
23 cd $2 # This `cd` is so java will pick up RustLexer.class. I couldn't
24 # figure out how to wrangle the CLASSPATH, just adding build/grammr didn't
25 # seem to have anny effect.
26 if $3 RustLexer tokens -tokens < $1 | $4 $1 $5; then
28 passed=`expr $passed + 1`
31 failed=`expr $failed + 1`
35 skipped=`expr $skipped + 1`
39 for file in $(find $1 -iname '*.rs' ! -path '*/test/compile-fail*'); do
40 check $file $2 $3 $4 $5
43 printf "\ntest result: "
45 if [ $failed -eq 0 ]; then
46 printf "ok. $passed passed; $failed failed; $skipped skipped\n\n"
48 printf "failed. $passed passed; $failed failed; $skipped skipped\n\n"