| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 # | 5 # |
| 6 # "compile and run tests" script for the android build of chromium. | 6 # "compile and run tests" script for the android build of chromium. |
| 7 # Intended for use by buildbot. | 7 # Intended for use by buildbot. |
| 8 # At this time, we only have one bot which is both a builder and | 8 # At this time, we only have one bot which is both a builder and |
| 9 # tester. Script assumes it runs in the "build" directory. | 9 # tester. Script assumes it runs in the "build" directory. |
| 10 # | 10 # |
| 11 # This script uses buildbot "Annotator" style for steps. | 11 # This script uses buildbot "Annotator" style for steps. |
| 12 # This script does not sync the source tree. | 12 # This script does not sync the source tree. |
| 13 | 13 |
| 14 set -e | 14 set -e |
| 15 set -x | 15 set -x |
| 16 | 16 |
| 17 # Options in this script. |
| 18 BUILD_EXPERIMENTAL_TARGETS=1 |
| 19 RUN_TESTS=1 |
| 17 NEED_CLOBBER=0 | 20 NEED_CLOBBER=0 |
| 21 JOBS=4 # make -j"${JOBS}" |
| 22 |
| 23 # If we are a trybot, disable experimental targets and tests. We |
| 24 # eventually want tests on a trybot but emulator launch/restart is not |
| 25 # reliable enough yet. |
| 26 # TODO(jrg): when setting up a trybot, make sure to add TRYBOT=1 in |
| 27 # the environment. |
| 28 if [ "${TRYBOT:-0}" = 1 ] ; then |
| 29 echo "Disabling experimental builds and tests since we are a trybot." |
| 30 BUILD_EXPERIMENTAL_TARGETS=0 |
| 31 RUN_TESTS=0 |
| 32 fi |
| 18 | 33 |
| 19 echo "@@@BUILD_STEP cd into source root@@@" | 34 echo "@@@BUILD_STEP cd into source root@@@" |
| 20 SRC_ROOT=$(cd "$(dirname $0)/../.."; pwd) | 35 SRC_ROOT=$(cd "$(dirname $0)/../.."; pwd) |
| 21 cd $SRC_ROOT | 36 cd $SRC_ROOT |
| 22 | 37 |
| 23 echo "@@@BUILD_STEP Basic setup@@@" | 38 echo "@@@BUILD_STEP Basic setup@@@" |
| 24 export ANDROID_SDK_ROOT=/usr/local/google/android-sdk-linux_x86 | 39 export ANDROID_SDK_ROOT=/usr/local/google/android-sdk-linux_x86 |
| 25 export ANDROID_NDK_ROOT=/usr/local/google/android-ndk-r7 | 40 export ANDROID_NDK_ROOT=/usr/local/google/android-ndk-r7 |
| 26 for mandatory_directory in "${ANDROID_SDK_ROOT}" "${ANDROID_NDK_ROOT}" ; do | 41 for mandatory_directory in "${ANDROID_SDK_ROOT}" "${ANDROID_NDK_ROOT}" ; do |
| 27 if [[ ! -d "${mandatory_directory}" ]]; then | 42 if [[ ! -d "${mandatory_directory}" ]]; then |
| (...skipping 14 matching lines...) Expand all Loading... |
| 42 | 57 |
| 43 if [ "$NEED_CLOBBER" -eq 1 ]; then | 58 if [ "$NEED_CLOBBER" -eq 1 ]; then |
| 44 echo "@@@BUILD_STEP Clobber@@@" | 59 echo "@@@BUILD_STEP Clobber@@@" |
| 45 rm -rf "${SRC_ROOT}"/out | 60 rm -rf "${SRC_ROOT}"/out |
| 46 fi | 61 fi |
| 47 | 62 |
| 48 echo "@@@BUILD_STEP android_gyp@@@" | 63 echo "@@@BUILD_STEP android_gyp@@@" |
| 49 android_gyp | 64 android_gyp |
| 50 | 65 |
| 51 echo "@@@BUILD_STEP Compile@@@" | 66 echo "@@@BUILD_STEP Compile@@@" |
| 52 make -j4 | 67 make -j${JOBS} |
| 53 | 68 |
| 54 # Linking DumpRenderTree appears to hang forever? | 69 if [ "${BUILD_EXPERIMENTAL_TARGETS}" = 1 ] ; then |
| 55 # EXPERIMENTAL_TARGETS="DumpRenderTree webkit_unit_tests" | 70 # Linking DumpRenderTree appears to hang forever? |
| 56 EXPERIMENTAL_TARGETS="webkit_unit_tests" | 71 # EXPERIMENTAL_TARGETS="DumpRenderTree webkit_unit_tests" |
| 57 for target in ${EXPERIMENTAL_TARGETS} ; do | 72 EXPERIMENTAL_TARGETS="webkit_unit_tests" |
| 58 echo "@@@BUILD_STEP Experimental Compile $target @@@" | 73 for target in ${EXPERIMENTAL_TARGETS} ; do |
| 59 set +e | 74 echo "@@@BUILD_STEP Experimental Compile $target @@@" |
| 60 make -j4 "${target}" | 75 set +e |
| 61 if [ $? -ne 0 ] ; then | 76 make -j4 "${target}" |
| 62 echo "@@@STEP_WARNINGS@@@" | 77 if [ $? -ne 0 ] ; then |
| 63 fi | 78 echo "@@@STEP_WARNINGS@@@" |
| 64 set -e | 79 fi |
| 65 done | 80 set -e |
| 81 done |
| 82 fi |
| 66 | 83 |
| 67 echo "@@@BUILD_STEP Run Tests@@@" | 84 if [ "${RUN_TESTS}" = 1 ] ; then |
| 68 build/android/run_tests.py -e --xvfb --verbose | 85 echo "@@@BUILD_STEP Run Tests@@@" |
| 86 build/android/run_tests.py -e --xvfb --verbose |
| 87 fi |
| 69 | 88 |
| 70 exit 0 | 89 exit 0 |
| OLD | NEW |