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 17# Helper script for running unit tests for compatibility libraries 18 19CTS_DIR=$(dirname ${0}) 20source ${CTS_DIR}/test_defs.sh 21 22echo 23echo "---- BUILD ---- " 24echo 25 26# check if in Android build env 27if [ ! -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; 37fi; 38 39BUILD_TARGETS=" 40 compatibility-common-util-tests\ 41 compatibility-host-util-tests\ 42 compatibility-device-util-tests\ 43 compatibility-tradefed-tests\ 44 cts-tradefed-tests\ 45 compatibility-device-info-tests\ 46 compatibility-manifest-generator-tests 47 CompatibilityTestApp" 48 49pushd ${CTS_DIR}/.. 50make ${BUILD_TARGETS} -j32 51BUILD_STATUS=$? 52popd 53if [ "${BUILD_STATUS}" != "0" ]; then 54 echo "BUILD FAILED - EXIT" 55 exit 1; 56fi; 57 58 59echo 60echo "---- DEVICE-SIDE TESTS ---- " 61echo 62 63${CTS_DIR}/common/device-side/test-app/run_tests.sh 64 65echo 66echo "---- HOST TESTS ---- " 67echo 68 69############### Run the host side tests ############### 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 74 75${CTS_DIR}/../test/suite_harness/tools/cts-tradefed/tests/run_tests.sh 76