Files
sdk/pkg/dev_compiler/test/test.sh
T
Sigmund Cherem 02a4650a24 Refactor: move code around a bit
- bin/
    devc.dart

- lib/
    devc.dart

    src/
       info.dart # static info we compute, used by checker & backends
       checker/  # implementation details for the checker
          checker.dart  # checking algorithm
          rules.dart    # type checking rules
          resolver.dart # same as today, type resolution via analyzer
       emitter/
          ...
- test/
     checker/    # unit tests for the checker internals
     codegen/    # left as is - maybe should rename to emitter?
     samples/    # stand alone samples that we run in the end_to_end tests.
     ...

R=vsm@google.com

Review URL: https://chromereviews.googleplex.com/128957013
2014-12-11 15:13:54 -08:00

1.2 KiB
Executable File

#!/bin/bash
set -e # bail on error
 
function fail {
echo -e "Some tests failed"
return 1
}
 
function show_diff {
echo "Fail: actual output did not match expected"
echo
diff -u -r -N $1 $2 |\
sed -e "s/^\(+.*\)/\1/" |\
sed -e "s/^\(-.*\)/\1/"
echo
echo "You can update these expectations with:"
echo "$ pushd $TEST_DIR/codegen"
echo "$ cp -a actual/* expect"
echo "$ popd"
fail
}
 
# the directory of this script
TEST_DIR=$( cd $( dirname "${BASH_SOURCE[0]}" ) && pwd )
 
# Some tests require being run from the package root
pushd $TEST_DIR/.. &> /dev/null
 
# Remove packages symlinks, and old codegen output
find test/codegen -name packages -exec rm {} \;
rm -r test/codegen/actual > /dev/null || true
dart -c test/all_tests.dart || fail
 
# validate codegen_test output
pushd test/codegen/ &> /dev/null
diff -u -r -N expect actual > /dev/null || show_diff expect actual
popd &> /dev/null
 
# run self host and analyzer after other tests, because they're ~seconds to run.
dart -c test/checker/self_host_test.dart || fail
 
ls lib/*.dart bin/*.dart | dartanalyzer -b --fatal-warnings || fail
popd &> /dev/null
 
echo -e "All tests pass"