OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 # Usage: call directly in the commandline as test/run.sh ensuring that you have | 6 # Usage: call directly in the commandline as test/run.sh ensuring that you have |
7 # both 'dart' and 'DumpRenderTree' in your path. Filter tests by passing a | 7 # both 'dart' and 'DumpRenderTree' in your path. Filter tests by passing a |
8 # pattern as an argument to this script. | 8 # pattern as an argument to this script. |
9 | 9 |
10 # TODO(sigmund): replace with a real test runner | 10 # TODO(sigmund): replace with a real test runner |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 pushd $DIR | 76 pushd $DIR |
77 dart $DART_FLAGS run_all.dart $TEST_PATTERN | 77 dart $DART_FLAGS run_all.dart $TEST_PATTERN |
78 popd | 78 popd |
79 | 79 |
80 # TODO(jmesserly): bash and dart regexp might not be 100% the same. Ideally we | 80 # TODO(jmesserly): bash and dart regexp might not be 100% the same. Ideally we |
81 # could do all the heavy lifting in Dart code, and keep this script as a thin | 81 # could do all the heavy lifting in Dart code, and keep this script as a thin |
82 # wrapper that sets `--enable-type-checks --enable-asserts` | 82 # wrapper that sets `--enable-type-checks --enable-asserts` |
83 for input in $DIR/data/input/*_test.html; do | 83 for input in $DIR/data/input/*_test.html; do |
84 if [[ ($TEST_PATTERN == "") || ($input =~ $TEST_PATTERN) ]]; then | 84 if [[ ($TEST_PATTERN == "") || ($input =~ $TEST_PATTERN) ]]; then |
85 FILENAME=`basename $input.html` | 85 FILENAME=`basename $input` |
86 echo -e -n "Testing $FILENAME " | 86 echo -e -n "Testing $FILENAME " |
87 DUMP="$DIR/data/output/$FILENAME.txt" | 87 DUMP="$DIR/data/output/$FILENAME.txt" |
88 EXPECTATION="$DIR/data/expected/$FILENAME.txt" | 88 EXPECTATION="$DIR/data/expected/$FILENAME.txt" |
89 DART_PACKAGE_ROOT="file://$DIR/packages/" \ | 89 DART_PACKAGE_ROOT="file://$DIR/packages/" \ |
90 DumpRenderTree $DIR/data/output/_$FILENAME > $DUMP | 90 DumpRenderTree $DIR/data/output/$FILENAME > $DUMP |
91 | 91 |
92 compare $EXPECTATION $DUMP | 92 compare $EXPECTATION $DUMP |
93 fi | 93 fi |
94 done | 94 done |
95 | 95 |
96 # Run Dart analyzer to check that we're generating warning clean code. | 96 # Run Dart analyzer to check that we're generating warning clean code. |
97 OUT_PATTERN="$DIR/data/output/*$TEST_PATTERN*_bootstrap.dart" | 97 OUT_PATTERN="$DIR/data/output/*$TEST_PATTERN*_bootstrap.dart" |
98 if [[ `ls $OUT_PATTERN 2>/dev/null` != "" ]]; then | 98 if [[ `ls $OUT_PATTERN 2>/dev/null` != "" ]]; then |
99 echo -e "\n Analyzing generated code for warnings or type errors." | 99 echo -e "\n Analyzing generated code for warnings or type errors." |
100 # TODO(jmesserly): batch mode does not return the right exit code. | 100 # TODO(jmesserly): batch mode does not return the right exit code. |
101 ls $OUT_PATTERN | dart_analyzer --fatal-warnings --fatal-type-errors \ | 101 ls $OUT_PATTERN | dart_analyzer --fatal-warnings --fatal-type-errors \ |
102 --work $DIR/data/output/analyzer/ -batch | 102 --work $DIR/data/output/analyzer/ -batch |
103 fi | 103 fi |
104 | 104 |
105 echo All tests pass. | 105 echo All tests pass. |
OLD | NEW |