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/tools/utils.sh" |
| 7 |
| 8 # Check that the necessary environment variables are set. |
| 9 check_env_variable "DART_SDK" |
| 10 check_env_variable "APPENGINE_DEVAPPSERVER" |
| 11 check_env_variable "APPENGINE_API_SERVER" |
| 12 |
| 13 export PY_BOOTSTRAP_APP="$REPO_ROOT/python/bootstrap.py" |
| 14 export PATH="$PATH:$DART_SDK/bin" |
| 15 export RETURN_VALUE=0 |
| 16 |
| 17 |
| 18 start_phase "Analyzing" |
| 19 analyze_file "$REPO_ROOT/dart/bin/main.dart" |
| 20 RETURN_VALUE=$(expr $RETURN_VALUE + $?) |
| 21 |
| 22 |
| 23 ############################################################## |
| 24 # Phase 1: Python => Dart |
| 25 ############################################################## |
| 26 |
| 27 start_phase "Testing Python => Dart" |
| 28 |
| 29 "$APPENGINE_API_SERVER" -A 'dev~test-application' \ |
| 30 --api_port 4444 --high_replication & |
| 31 API_SERVER_PID=$! |
| 32 sleep 3 |
| 33 |
| 34 |
| 35 |
| 36 "$PY_BOOTSTRAP_APP" "write" |
| 37 RETURN_VALUE=$(expr $RETURN_VALUE + $?) |
| 38 |
| 39 |
| 40 test_file "$REPO_ROOT/dart/bin/main.dart" "read" |
| 41 RETURN_VALUE=$(expr $RETURN_VALUE + $?) |
| 42 |
| 43 |
| 44 kill $API_SERVER_PID &> /dev/null |
| 45 |
| 46 |
| 47 # Wait until background jobs are done. |
| 48 wait |
| 49 echo |
| 50 echo |
| 51 echo |
| 52 |
| 53 |
| 54 ############################################################## |
| 55 # Phase 2: Python => Python |
| 56 ############################################################## |
| 57 |
| 58 start_phase "Testing Python => Python" |
| 59 |
| 60 "$APPENGINE_API_SERVER" -A 'dev~test-application' \ |
| 61 --api_port 4444 --high_replication & |
| 62 API_SERVER_PID=$! |
| 63 sleep 3 |
| 64 |
| 65 |
| 66 "$PY_BOOTSTRAP_APP" "write" |
| 67 RETURN_VALUE=$(expr $RETURN_VALUE + $?) |
| 68 |
| 69 |
| 70 "$PY_BOOTSTRAP_APP" "read" |
| 71 RETURN_VALUE=$(expr $RETURN_VALUE + $?) |
| 72 |
| 73 |
| 74 kill $API_SERVER_PID &> /dev/null |
| 75 |
| 76 |
| 77 # Wait until background jobs are done. |
| 78 wait |
| 79 echo |
| 80 echo |
| 81 echo |
| 82 |
| 83 ############################################################## |
| 84 # Phase 3: Dart => Python |
| 85 ############################################################## |
| 86 |
| 87 start_phase "Testing Dart => Python" |
| 88 |
| 89 "$APPENGINE_API_SERVER" -A 'dev~test-application' \ |
| 90 --api_port 4444 --high_replication & |
| 91 API_SERVER_PID=$! |
| 92 sleep 3 |
| 93 |
| 94 |
| 95 test_file "$REPO_ROOT/dart/bin/main.dart" "write" |
| 96 RETURN_VALUE=$(expr $RETURN_VALUE + $?) |
| 97 |
| 98 |
| 99 "$PY_BOOTSTRAP_APP" "read" |
| 100 RETURN_VALUE=$(expr $RETURN_VALUE + $?) |
| 101 |
| 102 |
| 103 kill $API_SERVER_PID &> /dev/null |
| 104 |
| 105 |
| 106 # Wait until background jobs are done. |
| 107 wait |
| 108 echo |
| 109 echo |
| 110 echo |
| 111 |
| 112 |
| 113 ############################################################## |
| 114 # Phase 4: Dart => Dart |
| 115 ############################################################## |
| 116 |
| 117 start_phase "Testing Dart => Dart" |
| 118 |
| 119 "$APPENGINE_API_SERVER" -A 'dev~test-application' \ |
| 120 --api_port 4444 --high_replication & |
| 121 API_SERVER_PID=$! |
| 122 sleep 3 |
| 123 |
| 124 |
| 125 test_file "$REPO_ROOT/dart/bin/main.dart" "write" |
| 126 RETURN_VALUE=$(expr $RETURN_VALUE + $?) |
| 127 |
| 128 |
| 129 test_file "$REPO_ROOT/dart/bin/main.dart" "read" |
| 130 RETURN_VALUE=$(expr $RETURN_VALUE + $?) |
| 131 |
| 132 |
| 133 kill $API_SERVER_PID &> /dev/null |
| 134 |
| 135 |
| 136 # Wait until background jobs are done. |
| 137 wait |
| 138 echo |
| 139 echo |
| 140 echo |
| 141 |
| 142 exit $RETURN_VALUE |
OLD | NEW |