Stuart Scott | b9a5c84 | 2015-04-23 14:41:29 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Copyright (C) 2015 The Android Open Source Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
Stuart Scott | 76f0d6d | 2015-06-02 08:13:27 -0700 | [diff] [blame] | 17 | # Helper script for running unit tests for compatibility libraries |
Stuart Scott | b9a5c84 | 2015-04-23 14:41:29 -0700 | [diff] [blame] | 18 | |
Kalle Raita | f4a9062 | 2015-12-09 13:31:36 -0800 | [diff] [blame] | 19 | CTS_DIR=$(dirname ${0}) |
| 20 | source ${CTS_DIR}/test_defs.sh |
| 21 | |
| 22 | echo |
| 23 | echo "---- BUILD ---- " |
| 24 | echo |
Stuart Scott | b9a5c84 | 2015-04-23 14:41:29 -0700 | [diff] [blame] | 25 | |
| 26 | # check if in Android build env |
| 27 | if [ ! -z ${ANDROID_BUILD_TOP} ]; then |
| 28 | HOST=`uname` |
| 29 | if [ "$HOST" == "Linux" ]; then |
| 30 | OS="linux-x86" |
| 31 | elif [ "$HOST" == "Darwin" ]; then |
| 32 | OS="darwin-x86" |
| 33 | else |
| 34 | echo "Unrecognized OS" |
| 35 | exit |
| 36 | fi; |
| 37 | fi; |
| 38 | |
Kalle Raita | f4a9062 | 2015-12-09 13:31:36 -0800 | [diff] [blame] | 39 | BUILD_TARGETS=" |
| 40 | compatibility-common-util-tests\ |
| 41 | compatibility-host-util-tests\ |
| 42 | compatibility-device-util-tests\ |
| 43 | compatibility-tradefed-tests\ |
Stuart Scott | 2ff78ae | 2016-02-18 19:25:52 -0800 | [diff] [blame] | 44 | cts-tradefed-tests\ |
Kalle Raita | f4a9062 | 2015-12-09 13:31:36 -0800 | [diff] [blame] | 45 | compatibility-device-info-tests\ |
| 46 | compatibility-manifest-generator-tests |
Kalle Raita | f4a9062 | 2015-12-09 13:31:36 -0800 | [diff] [blame] | 47 | CompatibilityTestApp" |
Stuart Scott | e1cd40d | 2015-10-15 12:16:11 -0700 | [diff] [blame] | 48 | |
Kalle Raita | f4a9062 | 2015-12-09 13:31:36 -0800 | [diff] [blame] | 49 | pushd ${CTS_DIR}/.. |
| 50 | make ${BUILD_TARGETS} -j32 |
| 51 | BUILD_STATUS=$? |
| 52 | popd |
| 53 | if [ "${BUILD_STATUS}" != "0" ]; then |
| 54 | echo "BUILD FAILED - EXIT" |
| 55 | exit 1; |
| 56 | fi; |
Stuart Scott | b9a5c84 | 2015-04-23 14:41:29 -0700 | [diff] [blame] | 57 | |
Stuart Scott | 76f0d6d | 2015-06-02 08:13:27 -0700 | [diff] [blame] | 58 | |
Kalle Raita | f4a9062 | 2015-12-09 13:31:36 -0800 | [diff] [blame] | 59 | echo |
| 60 | echo "---- DEVICE-SIDE TESTS ---- " |
| 61 | echo |
| 62 | |
| 63 | ${CTS_DIR}/common/device-side/test-app/run_tests.sh |
| 64 | |
| 65 | echo |
| 66 | echo "---- HOST TESTS ---- " |
| 67 | echo |
Stuart Scott | 76f0d6d | 2015-06-02 08:13:27 -0700 | [diff] [blame] | 68 | |
Stuart Scott | ff15fe9 | 2015-08-28 15:34:10 -0700 | [diff] [blame] | 69 | ############### Run the host side tests ############### |
Fang Deng | dbc2e98 | 2018-05-15 19:07:48 -0700 | [diff] [blame] | 70 | ${CTS_DIR}/../test/suite_harness/common/host-side/tradefed/tests/run_tests.sh |
| 71 | ${CTS_DIR}/../test/suite_harness/common/host-side/manifest-generator/tests/run_tests.sh |
| 72 | ${CTS_DIR}/../test/suite_harness/common/host-side/util/tests/run_tests.sh |
| 73 | ${CTS_DIR}/../test/suite_harness/common/util/tests/run_tests.sh |
Stuart Scott | ff15fe9 | 2015-08-28 15:34:10 -0700 | [diff] [blame] | 74 | |
Fang Deng | dbc2e98 | 2018-05-15 19:07:48 -0700 | [diff] [blame] | 75 | ${CTS_DIR}/../test/suite_harness/tools/cts-tradefed/tests/run_tests.sh |