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