OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 |
| 3 REPO_ROOT=$( cd $(dirname $(dirname "${BASH_SOURCE[0]}" )) && pwd ) |
| 4 |
| 5 # Source utility functions |
| 6 source "$REPO_ROOT/tool/utils.sh" |
| 7 |
| 8 # Check that the necessary environment variables are set. |
| 9 check_env_variable "DART_SDK" |
| 10 check_env_variable "APPENGINE_API_SERVER" |
| 11 |
| 12 export PATH="$PATH:$DART_SDK/bin" |
| 13 export RETURN_VALUE=0 |
| 14 |
| 15 start_phase "Analyzing" |
| 16 analyze_files $(find $REPO_ROOT/lib -name "*.dart") |
| 17 RETURN_VALUE=$(expr $RETURN_VALUE + $?) |
| 18 |
| 19 analyze_files $(find $REPO_ROOT/test -name '*.dart') |
| 20 RETURN_VALUE=$(expr $RETURN_VALUE + $?) |
| 21 |
| 22 start_phase "Starting API server" |
| 23 "$APPENGINE_API_SERVER" -A 'dev~test-application' \ |
| 24 --api_port 4444 --high_replication & |
| 25 API_SERVER_PID=$! |
| 26 sleep 3 |
| 27 |
| 28 |
| 29 start_phase "Testing" |
| 30 for testfile in $(find $REPO_ROOT/test -name "*test.dart"); do |
| 31 pushd "$REPO_ROOT/test" |
| 32 test_file "$testfile" |
| 33 RETURN_VALUE=$(expr $RETURN_VALUE + $?) |
| 34 popd |
| 35 done |
| 36 |
| 37 |
| 38 start_phase "Killing API server" |
| 39 kill $API_SERVER_PID &> /dev/null |
| 40 |
| 41 |
| 42 # Wait until background jobs are done. |
| 43 wait |
| 44 echo |
| 45 echo |
| 46 |
| 47 test $RETURN_VALUE -ne 0 && exit 1 |
| 48 exit 0 |
OLD | NEW |