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
This commit is contained in:
nileshagrawal@chromium.org 2012-05-16 03:46:39 +00:00
Родитель c16ec67a75
Коммит c6fb20115b
3 изменённых файлов: 27 добавлений и 16 удалений

Просмотреть файл

@ -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
}

Просмотреть файл

@ -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

Просмотреть файл

@ -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