From c6fb20115b379b69b3b50700d63cfa3ff2b2f36f Mon Sep 17 00:00:00 2001 From: "nileshagrawal@chromium.org" Date: Wed, 16 May 2012 03:46:39 +0000 Subject: [PATCH] Run APK tests on the android_test trybot. Test failures are ignored for now. TBR=mark@chromium.org,tsepez@chromium.org BUG=125059 TEST= Review URL: https://chromiumcodereview.appspot.com/10387086 git-svn-id: http://src.chromium.org/svn/trunk/src/build@137352 4ff67af0-8c30-449e-8e8b-ad334ec8d88c --- android/buildbot_functions.sh | 27 +++++++++++++++------------ android/buildbot_try_compile_test.sh | 3 ++- android/run_tests.py | 13 ++++++++++--- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/android/buildbot_functions.sh b/android/buildbot_functions.sh index 2ea50f396..1db548eab 100755 --- a/android/buildbot_functions.sh +++ b/android/buildbot_functions.sh @@ -194,23 +194,12 @@ function bb_compile { # Re-gyp and compile with unit test bundles configured as shlibs for # the native test runner. Experimental for now. Once the native test # loader is on by default, this entire function becomes obsolete. -function bb_native_test_compile_run_tests { +function bb_compile_apk_tests { echo "@@@BUILD_STEP Re-gyp for the native test runner@@@" GYP_DEFINES="$GYP_DEFINES gtest_target_type=shared_library" android_gyp echo "@@@BUILD_STEP Native test runner compile@@@" bb_goma_make - - # Make sure running the template prints an expected failure. - echo "@@@BUILD_STEP Native test runner template test@@@" - tempfile=/tmp/tempfile-$$.txt - build/android/run_tests.py --xvfb --verbose \ - -s out/Release/replaceme_apk/replaceme-debug.apk \ - | sed 's/@@@STEP_FAILURE@@@//g' | tee $tempfile - happy_failure=$(cat $tempfile | grep RUNNER_FAILED | wc -l) - if [[ $happy_failure -eq 0 ]] ; then - echo "@@@STEP_WARNINGS@@@" - fi } # Experimental compile step; does not turn the tree red if it fails. @@ -239,3 +228,17 @@ function bb_run_tests { echo "@@@BUILD_STEP Run Tests on actual hardware@@@" build/android/run_tests.py --xvfb --verbose } + +# Run APK tests on an actual device. +function bb_run_apk_tests { + echo "@@@BUILD_STEP Run APK Tests on actual hardware@@@" + tempfile=/tmp/tempfile-$$.txt + # Filter out STEP_FAILURES, we don't want REDNESS on test failures for now. + build/android/run_tests.py --xvfb --verbose --apk=True \ + | sed 's/@@@STEP_FAILURE@@@//g' | tee $tempfile + happy_failure=$(cat $tempfile | grep RUNNER_FAILED | wc -l) + if [[ $happy_failure -eq 0 ]] ; then + echo "@@@STEP_WARNINGS@@@" + fi + rm -f $tempfile +} diff --git a/android/buildbot_try_compile_test.sh b/android/buildbot_try_compile_test.sh index e48ed1bde..58a7919cb 100755 --- a/android/buildbot_try_compile_test.sh +++ b/android/buildbot_try_compile_test.sh @@ -16,4 +16,5 @@ bb_baseline_setup "${ROOT}"/../.. bb_install_build_deps "${ROOT}"/../.. bb_compile bb_run_tests -bb_native_test_compile_run_tests +bb_compile_apk_tests +bb_run_apk_tests diff --git a/android/run_tests.py b/android/run_tests.py index 6f59cb27c..f059a24a2 100755 --- a/android/run_tests.py +++ b/android/run_tests.py @@ -76,6 +76,13 @@ _TEST_SUITES = ['base_unittests', 'ui_unittests', ] +# Test suites which are build as an APK. This will be replaced by the default +# list when we start building all suites as APK. +_APK_TEST_SUITES = ['replaceme', # Test the template apk too. + 'base_unittests', + 'ipc_tests', + 'ui_unittests', + ] def FullyQualifiedTestSuites(apk): """Return a fully qualified list that represents all known suites. @@ -86,11 +93,11 @@ def FullyQualifiedTestSuites(apk): test_suite_dir = os.path.abspath(os.path.join(run_tests_helper.CHROME_DIR, 'out', 'Release')) if apk: - # out/Release/$SUITE_apk/ChromeNativeTests-debug.apk + # out/Release/$SUITE_apk/$SUITE-debug.apk suites = [os.path.join(test_suite_dir, t + '_apk', - 'ChromeNativeTests-debug.apk') - for t in _TEST_SUITES] + t + '-debug.apk') + for t in _APK_TEST_SUITES] else: suites = [os.path.join(test_suite_dir, t) for t in _TEST_SUITES] return suites