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 'content_shell' in your path. Filter tests by passing a | 7 # both 'dart' and 'content_shell' 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 13 matching lines...) Expand all Loading... |
24 } | 24 } |
25 | 25 |
26 function show_diff { | 26 function show_diff { |
27 diff -u -N $1 $2 | \ | 27 diff -u -N $1 $2 | \ |
28 sed -e "s/^\(+.*\)/[32m\1[0m/" |\ | 28 sed -e "s/^\(+.*\)/[32m\1[0m/" |\ |
29 sed -e "s/^\(-.*\)/[31m\1[0m/" | 29 sed -e "s/^\(-.*\)/[31m\1[0m/" |
30 return 1 | 30 return 1 |
31 } | 31 } |
32 | 32 |
33 function update { | 33 function update { |
34 read -p "Would you like to update the expectations? [y/N]: " answer | 34 read -p "Would you like to update the expectations? [y/N/s] (yes, No, skip thi
s one): " answer |
35 if [[ $answer == 'y' || $answer == 'Y' ]]; then | 35 if [[ $answer == 'y' || $answer == 'Y' ]]; then |
36 cp $2 $1 | 36 cp $2 $1 |
37 return 0 | 37 return 0 |
| 38 elif [[ $answer == 's' ]]; then |
| 39 return 0 |
38 fi | 40 fi |
39 return 1 | 41 return 1 |
40 } | 42 } |
41 | 43 |
42 function pass { | 44 function pass { |
43 echo -e "[32mOK[0m" | 45 echo -e "[32mOK[0m" |
44 } | 46 } |
45 | 47 |
46 function compare { | 48 function compare { |
47 # use a standard diff, if they are not identical, format the diff nicely to | 49 # use a standard diff, if they are not identical, format the diff nicely to |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 # It's a bit slow, so only do this for TodoMVC and html5_utils tests. | 131 # It's a bit slow, so only do this for TodoMVC and html5_utils tests. |
130 OUT_PATTERN="$DIR/data/out/html5_utils_*$TEST_PATTERN*_bootstrap.dart $DIR/../ex
ample/todomvc/test/out/test/*$TEST_PATTERN*_bootstrap.dart" | 132 OUT_PATTERN="$DIR/data/out/html5_utils_*$TEST_PATTERN*_bootstrap.dart $DIR/../ex
ample/todomvc/test/out/test/*$TEST_PATTERN*_bootstrap.dart" |
131 if [[ `ls $OUT_PATTERN 2>/dev/null` != "" ]]; then | 133 if [[ `ls $OUT_PATTERN 2>/dev/null` != "" ]]; then |
132 echo -e "\nAnalyzing generated code for warnings or type errors." | 134 echo -e "\nAnalyzing generated code for warnings or type errors." |
133 ls $OUT_PATTERN 2>/dev/null | dartanalyzer --package-root=packages \ | 135 ls $OUT_PATTERN 2>/dev/null | dartanalyzer --package-root=packages \ |
134 --fatal-warnings --fatal-type-errors -batch || | 136 --fatal-warnings --fatal-type-errors -batch || |
135 echo -e "Ignoring analyzer errors ([36mdartbug.com/9433[0m)" | 137 echo -e "Ignoring analyzer errors ([36mdartbug.com/9433[0m)" |
136 fi | 138 fi |
137 | 139 |
138 echo -e "[32mAll tests pass[0m" | 140 echo -e "[32mAll tests pass[0m" |
OLD | NEW |