Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(905)

Side by Side Diff: test/test.sh

Issue 998043002: Fixes in codegen and test script (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/codegen/try_catch.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 set -e # bail on error 2 set -e # bail on error
3 3
4 function fail { 4 function fail {
5 echo -e "Some tests failed" 5 echo -e "Some tests failed"
6 return 1 6 return 1
7 } 7 }
8 8
9 # Arguments passed to the diff tool. We exclude: 9 # Arguments passed to the diff tool. We exclude:
10 # - *.map files so they aren't compared, as the diff is not human readable. 10 # - *.map files so they aren't compared, as the diff is not human readable.
11 # - runtime JS files that are just copied over from the sources and are not 11 # - runtime JS files that are just copied over from the sources and are not
12 # duplicated in the expected folder. 12 # duplicated in the expected folder.
13 DIFF_ARGS="-u -r -N --exclude=\*.map \ 13 DIFF_ARGS="-u -r -N --exclude=\*.map \
14 --exclude=dart_runtime.js \ 14 --exclude=dart_runtime.js \
15 --exclude=dart_core.js \ 15 --exclude=dart_core.js \
16 --exclude=harmony_feature_check.js \ 16 --exclude=harmony_feature_check.js \
17 --exclude=messages_widget.js \ 17 --exclude=messages_widget.js \
18 --exclude=messages.css \ 18 --exclude=messages.css \
19 expect actual" 19 expect actual"
20 20
21 function show_diff { 21 function show_diff {
22 echo "Fail: actual output did not match expected" 22 echo "Fail: actual output did not match expected"
23 echo 23 echo
24 diff $DIFF_ARGS |\ 24 diff $DIFF_ARGS |\
25 sed -e "s/^\(+.*\)/\1/" |\ 25 sed -e "s/^\(+.*\)/\1/" |\
26 sed -e "s/^\(-.*\)/\1/" 26 sed -e "s/^\(-.*\)/\1/"
27 echo 27 echo
28 echo "You can update these expectations with:" 28 echo "You can update these expectations with:"
29 echo "$ pushd `pwd` && cp -a actual/* expect && popd" 29 echo "$ cp -a test/codegen/actual/* test/codegen/expect"
Jennifer Messerly 2015/03/11 23:48:00 This doesn't work if you're standing in a folder b
Siggi Cherem (dart-lang) 2015/03/12 00:16:26 Ah, I see, never mind, I somehow missed that. reve
30 fail 30 fail
31 } 31 }
32 32
33 # the directory of this script 33 # the directory of this script
34 TEST_DIR=$( cd $( dirname "${BASH_SOURCE[0]}" ) && pwd ) 34 TEST_DIR=$( cd $( dirname "${BASH_SOURCE[0]}" ) && pwd )
35 35
36 # Some tests require being run from the package root 36 # Some tests require being run from the package root
37 cd $TEST_DIR/.. 37 cd $TEST_DIR/..
38 38
39 # Check minimum SDK version 39 # Check minimum SDK version
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 # * local files that have never been added to git, 80 # * local files that have never been added to git,
81 # * subdirectories of test/ and tool/, unless explicitly added. Those dirs 81 # * subdirectories of test/ and tool/, unless explicitly added. Those dirs
82 # contain a lot of generated or external source we should not reformat. 82 # contain a lot of generated or external source we should not reformat.
83 (files=`git ls-files 'bin/*.dart' 'lib/*.dart' test/*.dart test/checker/*.dart \ 83 (files=`git ls-files 'bin/*.dart' 'lib/*.dart' test/*.dart test/checker/*.dart \
84 tool/*.dart | grep -v lib/src/js/`; git status -s $files | grep -q . \ 84 tool/*.dart | grep -v lib/src/js/`; git status -s $files | grep -q . \
85 && echo "Did not run the formatter, please commit edited files first." \ 85 && echo "Did not run the formatter, please commit edited files first." \
86 || (echo "Running dart formatter" ; pub run dart_style:format -w $files)) 86 || (echo "Running dart formatter" ; pub run dart_style:format -w $files))
87 popd &> /dev/null 87 popd &> /dev/null
88 88
89 echo -e "All tests pass" 89 echo -e "All tests pass"
OLDNEW
« no previous file with comments | « test/codegen/try_catch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698