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

Unified 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. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/appengine/test/dart-python--datastore-compatibility/tools/utils.sh
diff --git a/pkg/appengine/test/dart-python--datastore-compatibility/tools/utils.sh b/pkg/appengine/test/dart-python--datastore-compatibility/tools/utils.sh
new file mode 100644
index 0000000000000000000000000000000000000000..eada17f4e895628e23bc465b2663aa5321763fcf
--- /dev/null
+++ b/pkg/appengine/test/dart-python--datastore-compatibility/tools/utils.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+function start_phase {
+ echo "==============================================="
+ echo "= Phase: $1"
+ echo "==============================================="
+}
+
+function error {
+ echo "==============================================="
+ echo "= Error: $1"
+ echo "==============================================="
+}
+
+function die {
+ echo "$1"
+ exit 1
+}
+
+function check_env_variable {
+ NAME="$1"
+ env | grep "$NAME" &> /dev/null
+ if [ $? -ne 0 ]; then
+ die "Couldn't find environment variable '$NAME'!"
+ fi
+}
+
+function analyze_file {
+ echo "Analyzing file '$1'."
+ # Hack because dartanalyzer doesn't look into packages/ directory next to
+ # entry point (if pacakges are nested).
+ PACKAGE_ROOT="$(dirname $1)/packages"
+
+ "$DART_SDK/bin/dartanalyzer" "--package-root=$PACKAGE_ROOT" --fatal-warnings "$1"
+ if [ $? -ne 0 ]; then
+ error "Analyzer failed on file '$1'."
+ return 1
+ fi
+ return 0
+}
+
+function test_file {
+ echo "Testing file '$1'."
+ "$DART_SDK/bin/dart" --checked "$@"
+ if [ $? -ne 0 ]; then
+ error "Running tests in '$1' failed."
+ return 1
+ fi
+ return 0
+}
+

Powered by Google App Engine
This is Rietveld 408576698