Index: build/android/buildbot/buildbot_functions.sh |
diff --git a/build/android/buildbot/buildbot_functions.sh b/build/android/buildbot/buildbot_functions.sh |
index 25e89c40a82f98eaf69a4cf47b791dd935c712bd..ba563b79a785b2568694f77f92347775d0a54264 100755 |
--- a/build/android/buildbot/buildbot_functions.sh |
+++ b/build/android/buildbot/buildbot_functions.sh |
@@ -212,18 +212,36 @@ function bb_run_unit_tests { |
# $1: TEST_APK. |
# $2: EXTRA_FLAGS to be passed to run_instrumentation_tests.py. |
function bb_run_instrumentation_test { |
+ ( |
local TEST_APK=${1} |
local EXTRA_FLAGS=${2} |
local INSTRUMENTATION_FLAGS="-vvv" |
INSTRUMENTATION_FLAGS+=" --test-apk ${TEST_APK}" |
INSTRUMENTATION_FLAGS+=" ${EXTRA_FLAGS}" |
- build/android/run_instrumentation_tests.py ${INSTRUMENTATION_FLAGS} |
+ set +e |
bulach
2012/10/02 10:40:46
I'm not terribly familiar with bash, but is a "set
klundberg
2012/10/02 18:40:06
I discussed this with Isaac and we don't need "set
|
+ python build/android/run_instrumentation_tests.py ${INSTRUMENTATION_FLAGS} |
+ local TEST_RUN_EXIT_CODE=$? |
+ if (( $TEST_RUN_EXIT_CODE != 0 )); then |
Isaac (away)
2012/10/02 05:13:37
use a [[ ]] test here
klundberg
2012/10/02 18:40:06
Done.
|
+ echo "@@@STEP_FAILURE@@@" |
+ fi |
+ # Regardless of whether tests failed or crashed we don't want to stop the |
+ # entire buildbot flow. |
+ return 0 |
Isaac (away)
2012/10/02 05:13:37
return is not technically necessary here but it's
klundberg
2012/10/02 18:40:06
Done.
|
+ ) |
} |
-# Run content shell instrumentation test on device. |
-function bb_run_instrumentation_tests { |
- build/android/adb_install_content_shell |
- local TEST_APK="ContentShellTest" |
+# Run instrumentation test. |
+# Args: |
+# $1: TEST_APK. |
+# $2: EXTRA_FLAGS to be passed to run_instrumentation_tests.py. |
bulach
2012/10/02 10:40:46
nit: $3: ... ? :)
klundberg
2012/10/02 18:40:06
Done.
|
+function bb_run_instrumentation_tests_apk { |
+ local APK=${1} |
+ local TEST_APK=${2} |
+ local APK_PACKAGE=${3} |
+ echo ${1} ${2} ${3} |
+ python build/android/adb_install_apk.py --apk ${APK} \ |
+ --apk_package ${APK_PACKAGE} |
+ |
# Use -I to install the test apk only on the first run. |
# TODO(bulach): remove the second once we have a Smoke test. |
bb_run_instrumentation_test ${TEST_APK} "-I -A Smoke" |
@@ -232,6 +250,16 @@ function bb_run_instrumentation_tests { |
bb_run_instrumentation_test ${TEST_APK} "-A LargeTest" |
} |
+# Run content shell instrumentation test on device. |
+function bb_run_instrumentation_tests { |
bulach
2012/10/02 10:40:46
hmm, these three methods sound too similar..
would
klundberg
2012/10/02 18:40:06
I discussed this with Isaac and since we don't car
|
+ bb_run_instrumentation_tests_apk "ContentShell-debug.apk" \ |
+ "ContentShellTest" "org.chromium.content_shell" |
+ bb_run_instrumentation_tests_apk "ChromiumTestShell-debug.apk" \ |
+ "ChromiumTestShellTest" "org.chromium.chrome.browser" |
+ bb_run_instrumentation_tests_apk "AndroidWebView-debug.apk" \ |
+ "AndroidWebViewTest" "org.chromium.android_webview" |
+} |
+ |
# Zip and archive a build. |
function bb_zip_build { |
echo "@@@BUILD_STEP Zip build@@@" |