| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 63 } |
| 64 | 64 |
| 65 function compare { | 65 function compare { |
| 66 # use a standard diff, if they are not identical, format the diff nicely to | 66 # use a standard diff, if they are not identical, format the diff nicely to |
| 67 # see what's the error and prompt to see if they wish to update it. If they | 67 # see what's the error and prompt to see if they wish to update it. If they |
| 68 # do, continue running more tests. | 68 # do, continue running more tests. |
| 69 diff -q $1 $2 && pass || show_diff $1 $2 || update $1 $2 | 69 diff -q $1 $2 && pass || show_diff $1 $2 || update $1 $2 |
| 70 } | 70 } |
| 71 | 71 |
| 72 if [[ ($TEST_PATTERN == "") ]]; then | 72 if [[ ($TEST_PATTERN == "") ]]; then |
| 73 echo Analyzing compiler for warnings or type errors | 73 echo Analyzing analyzer for warnings or type errors |
| 74 $dartanalyzer --hints --fatal-warnings --fatal-type-errors lib/dwc.dart |
| 75 |
| 76 echo Analyzing deploy-compiler for warnings or type errors |
| 74 $dartanalyzer --hints --fatal-warnings --fatal-type-errors lib/deploy.dart | 77 $dartanalyzer --hints --fatal-warnings --fatal-type-errors lib/deploy.dart |
| 75 | 78 |
| 76 echo -e "\nAnalyzing runtime for warnings or type errors" | 79 echo -e "\nAnalyzing runtime for warnings or type errors" |
| 77 $dartanalyzer --hints --fatal-warnings --fatal-type-errors lib/polymer.dart | 80 $dartanalyzer --hints --fatal-warnings --fatal-type-errors lib/polymer.dart |
| 78 | 81 |
| 79 popd > /dev/null | 82 popd > /dev/null |
| 80 fi | 83 fi |
| 81 | 84 |
| 82 function compare_all { | 85 function compare_all { |
| 83 # TODO(jmesserly): bash and dart regexp might not be 100% the same. Ideally we | 86 # TODO(jmesserly): bash and dart regexp might not be 100% the same. Ideally we |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 # Run Dart analyzer to check that we're generating warning clean code. | 123 # Run Dart analyzer to check that we're generating warning clean code. |
| 121 # It's a bit slow, so only do this for TodoMVC. | 124 # It's a bit slow, so only do this for TodoMVC. |
| 122 OUT_PATTERN="$DIR/../../../third_party/samples/todomvc/test/out/test/*$TEST_PATT
ERN*_bootstrap.dart" | 125 OUT_PATTERN="$DIR/../../../third_party/samples/todomvc/test/out/test/*$TEST_PATT
ERN*_bootstrap.dart" |
| 123 if [[ `ls $OUT_PATTERN 2>/dev/null` != "" ]]; then | 126 if [[ `ls $OUT_PATTERN 2>/dev/null` != "" ]]; then |
| 124 echo -e "\nAnalyzing generated code for warnings or type errors." | 127 echo -e "\nAnalyzing generated code for warnings or type errors." |
| 125 ls $OUT_PATTERN 2>/dev/null | $dartanalyzer --package-root=packages \ | 128 ls $OUT_PATTERN 2>/dev/null | $dartanalyzer --package-root=packages \ |
| 126 --fatal-warnings --fatal-type-errors -batch | 129 --fatal-warnings --fatal-type-errors -batch |
| 127 fi | 130 fi |
| 128 | 131 |
| 129 echo -e "[32mAll tests pass[0m" | 132 echo -e "[32mAll tests pass[0m" |
| OLD | NEW |