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

Side by Side Diff: tool/test.sh

Issue 1167233002: split analyze and format steps out of test.sh (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 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 | « tool/presubmit.sh ('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.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 # validate codegen_test output 43 # validate codegen_test output
44 pushd test/codegen/ &> /dev/null 44 pushd test/codegen/ &> /dev/null
45 rm -r actual/dev_compiler/ actual/sunflower/dev_compiler 45 rm -r actual/dev_compiler/ actual/sunflower/dev_compiler
46 diff $DIFF_ARGS > /dev/null || show_diff 46 diff $DIFF_ARGS > /dev/null || show_diff
47 popd &> /dev/null 47 popd &> /dev/null
48 48
49 # run self host and analyzer after other tests, because they're ~seconds to run. 49 # run self host and analyzer after other tests, because they're ~seconds to run.
50 pub run test:test test/checker/self_host_test.dart || fail 50 pub run test:test test/checker/self_host_test.dart || fail
51 51
52 # Run analyzer on bin/devc.dart, as it includes most of the code we care about
53 # via transitive dependencies. This seems to be the only fast way to avoid
54 # repeated analysis of the same code.
55 # TODO(jmesserly): ideally we could do test/all_tests.dart, but
56 # dart_runtime_test.dart creates invalid generic type instantiation AA.
57 echo "Running dartanalyzer to check for errors/warnings/hints..."
58 dartanalyzer --fatal-warnings --package-warnings bin/devc.dart | (! grep $PWD) \
59 || fail
60
61 { 52 {
62 fc=`find test -name "*.dart" |\ 53 fc=`find test -name "*.dart" |\
63 xargs grep "/\*\S* should be \S*\*/" | wc -l` 54 xargs grep "/\*\S* should be \S*\*/" | wc -l`
64 echo "There are" $fc "tests marked as known failures." 55 echo "There are" $fc "tests marked as known failures."
65 } 56 }
66 57
67 # Run formatter in rewrite mode on all files that are part of the project.
68 # This checks that all files are commited first to git, so no state is lost.
69 # The formatter ignores:
70 # * local files that have never been added to git,
71 # * subdirectories of test/ and tool/, unless explicitly added. Those dirs
72 # contain a lot of generated or external source we should not reformat.
73 (files=`git ls-files 'bin/*.dart' 'lib/*.dart' test/*.dart test/checker/*.dart \
74 tool/*.dart | grep -v lib/src/js/`; git status -s $files | grep -q . \
75 && echo "Did not run the formatter, please commit edited files first." \
76 || (echo "Running dart formatter" ; pub run dart_style:format -w $files))
77
78 echo -e "All tests pass" 58 echo -e "All tests pass"
OLDNEW
« no previous file with comments | « tool/presubmit.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698