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

Side by Side Diff: test/test.sh

Issue 979503002: skip map files in test.sh diff (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 | « no previous file | 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 runtime JS files that are just
10 # copied over from the sources and are not duplicated in the expected folder.
Siggi Cherem (dart-lang) 2015/03/03 21:30:08 folder. => folder and .map files. Or we could get
Jennifer Messerly 2015/03/03 22:08:18 Done.
11 DIFF_ARGS="-u -r -N --exclude=\*.map expect actual"
12
9 function show_diff { 13 function show_diff {
10 echo "Fail: actual output did not match expected" 14 echo "Fail: actual output did not match expected"
11 echo 15 echo
12 diff -u -r -N $1 $2 |\ 16 diff $DIFF_ARGS |\
13 sed -e "s/^\(+.*\)/\1/" |\ 17 sed -e "s/^\(+.*\)/\1/" |\
14 sed -e "s/^\(-.*\)/\1/" 18 sed -e "s/^\(-.*\)/\1/"
15 echo 19 echo
16 echo "You can update these expectations with:" 20 echo "You can update these expectations with:"
17 echo "$ pushd `pwd` && cp -a actual/* expect && popd" 21 echo "$ pushd `pwd` && cp -a actual/* expect && popd"
18 fail 22 fail
19 } 23 }
20 24
21 # the directory of this script 25 # the directory of this script
22 TEST_DIR=$( cd $( dirname "${BASH_SOURCE[0]}" ) && pwd ) 26 TEST_DIR=$( cd $( dirname "${BASH_SOURCE[0]}" ) && pwd )
23 27
24 # Some tests require being run from the package root 28 # Some tests require being run from the package root
25 cd $TEST_DIR/.. 29 cd $TEST_DIR/..
26 30
27 # Check minimum SDK version 31 # Check minimum SDK version
28 ./tool/sdk_version_check.dart 1.9.0-dev.4.0 || fail 32 ./tool/sdk_version_check.dart 1.9.0-dev.4.0 || fail
29 33
30 # Remove packages symlinks, and old codegen output 34 # Remove packages symlinks, and old codegen output
31 find test/codegen -name packages -exec rm {} \; 35 find test/codegen -name packages -exec rm {} \;
32 rm -r test/codegen/actual 2> /dev/null || true 36 rm -r test/codegen/actual 2> /dev/null || true
33 find test/dart_codegen -name packages -exec rm {} \; 37 find test/dart_codegen -name packages -exec rm {} \;
34 rm -r test/dart_codegen/actual 2> /dev/null || true 38 rm -r test/dart_codegen/actual 2> /dev/null || true
35 dart -c test/all_tests.dart || fail 39 dart -c test/all_tests.dart || fail
36 40
37 # validate codegen_test output 41 # validate codegen_test output
38 pushd test/codegen/ &> /dev/null 42 pushd test/codegen/ &> /dev/null
39 diff -u -r -N expect actual > /dev/null || show_diff expect actual 43 diff $DIFF_ARGS > /dev/null || show_diff
40 popd &> /dev/null 44 popd &> /dev/null
41 45
42 # validate dart_codegen_test output 46 # validate dart_codegen_test output
43 pushd test/dart_codegen/ &> /dev/null 47 pushd test/dart_codegen/ &> /dev/null
44 diff -u -r -N expect actual > /dev/null || show_diff expect actual 48 diff $DIFF_ARGS > /dev/null || show_diff
45 popd &> /dev/null 49 popd &> /dev/null
46 50
47 # run self host and analyzer after other tests, because they're ~seconds to run. 51 # run self host and analyzer after other tests, because they're ~seconds to run.
48 dart -c test/checker/self_host_test.dart || fail 52 dart -c test/checker/self_host_test.dart || fail
49 53
50 # Run analyzer on bin/devc.dart, as it includes most of the code we care about 54 # Run analyzer on bin/devc.dart, as it includes most of the code we care about
51 # via transitive dependencies. This seems to be the only fast way to avoid 55 # via transitive dependencies. This seems to be the only fast way to avoid
52 # repeated analysis of the same code. 56 # repeated analysis of the same code.
53 # TODO(jmesserly): ideally we could do test/all_tests.dart, but 57 # TODO(jmesserly): ideally we could do test/all_tests.dart, but
54 # dart_runtime_test.dart creates invalid generic type instantiation AA. 58 # dart_runtime_test.dart creates invalid generic type instantiation AA.
(...skipping 13 matching lines...) Expand all
68 # * local files that have never been added to git, 72 # * local files that have never been added to git,
69 # * subdirectories of test/ and tool/, unless explicitly added. Those dirs 73 # * subdirectories of test/ and tool/, unless explicitly added. Those dirs
70 # contain a lot of generated or external source we should not reformat. 74 # contain a lot of generated or external source we should not reformat.
71 (files=`git ls-files 'bin/*.dart' 'lib/*.dart' test/*.dart test/checker/*.dart \ 75 (files=`git ls-files 'bin/*.dart' 'lib/*.dart' test/*.dart test/checker/*.dart \
72 tool/*.dart | grep -v lib/src/js/`; git status -s $files | grep -q . \ 76 tool/*.dart | grep -v lib/src/js/`; git status -s $files | grep -q . \
73 && echo "Did not run the formatter, please commit edited files first." \ 77 && echo "Did not run the formatter, please commit edited files first." \
74 || (echo "Running dart formatter" ; pub run dart_style:format -w $files)) 78 || (echo "Running dart formatter" ; pub run dart_style:format -w $files))
75 popd &> /dev/null 79 popd &> /dev/null
76 80
77 echo -e "All tests pass" 81 echo -e "All tests pass"
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698