Chromium Code Reviews

Side by Side Diff: pkg/appengine/test/dart-python--datastore-compatibility/tools/utils.sh

Issue 804973002: Add appengine/gcloud/mustache dependencies. (Closed) Base URL: git@github.com:dart-lang/pub-dartlang-dart.git@master
Patch Set: Added AUTHORS/LICENSE/PATENTS files Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
(Empty)
1 #!/bin/bash
2
3 function start_phase {
4 echo "==============================================="
5 echo "= Phase: $1"
6 echo "==============================================="
7 }
8
9 function error {
10 echo "==============================================="
11 echo "= Error: $1"
12 echo "==============================================="
13 }
14
15 function die {
16 echo "$1"
17 exit 1
18 }
19
20 function check_env_variable {
21 NAME="$1"
22 env | grep "$NAME" &> /dev/null
23 if [ $? -ne 0 ]; then
24 die "Couldn't find environment variable '$NAME'!"
25 fi
26 }
27
28 function analyze_file {
29 echo "Analyzing file '$1'."
30 # Hack because dartanalyzer doesn't look into packages/ directory next to
31 # entry point (if pacakges are nested).
32 PACKAGE_ROOT="$(dirname $1)/packages"
33
34 "$DART_SDK/bin/dartanalyzer" "--package-root=$PACKAGE_ROOT" --fatal-warnings " $1"
35 if [ $? -ne 0 ]; then
36 error "Analyzer failed on file '$1'."
37 return 1
38 fi
39 return 0
40 }
41
42 function test_file {
43 echo "Testing file '$1'."
44 "$DART_SDK/bin/dart" --checked "$@"
45 if [ $? -ne 0 ]; then
46 error "Running tests in '$1' failed."
47 return 1
48 fi
49 return 0
50 }
51
OLDNEW

Powered by Google App Engine