blob: aaf0b1be24c88d47e00850339f9dd784a2457f20 [file] [log] [blame]
Stuart Scottb9a5c842015-04-23 14:41:29 -07001#!/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 Scott76f0d6d2015-06-02 08:13:27 -070017# Helper script for running unit tests for compatibility libraries
Stuart Scottb9a5c842015-04-23 14:41:29 -070018
Kalle Raitaf4a90622015-12-09 13:31:36 -080019CTS_DIR=$(dirname ${0})
20source ${CTS_DIR}/test_defs.sh
21
22echo
23echo "---- BUILD ---- "
24echo
Stuart Scottb9a5c842015-04-23 14:41:29 -070025
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
Kalle Raitaf4a90622015-12-09 13:31:36 -080039BUILD_TARGETS="
40 compatibility-common-util-tests\
41 compatibility-host-util-tests\
42 compatibility-device-util-tests\
43 compatibility-tradefed-tests\
Stuart Scott2ff78ae2016-02-18 19:25:52 -080044 cts-tradefed-tests\
Kalle Raitaf4a90622015-12-09 13:31:36 -080045 compatibility-device-info-tests\
46 compatibility-manifest-generator-tests
Kalle Raitaf4a90622015-12-09 13:31:36 -080047 CompatibilityTestApp"
Stuart Scotte1cd40d2015-10-15 12:16:11 -070048
Kalle Raitaf4a90622015-12-09 13:31:36 -080049pushd ${CTS_DIR}/..
50make ${BUILD_TARGETS} -j32
51BUILD_STATUS=$?
52popd
53if [ "${BUILD_STATUS}" != "0" ]; then
54 echo "BUILD FAILED - EXIT"
55 exit 1;
56fi;
Stuart Scottb9a5c842015-04-23 14:41:29 -070057
Stuart Scott76f0d6d2015-06-02 08:13:27 -070058
Kalle Raitaf4a90622015-12-09 13:31:36 -080059echo
60echo "---- DEVICE-SIDE TESTS ---- "
61echo
62
63${CTS_DIR}/common/device-side/test-app/run_tests.sh
64
65echo
66echo "---- HOST TESTS ---- "
67echo
Stuart Scott76f0d6d2015-06-02 08:13:27 -070068
Stuart Scottff15fe92015-08-28 15:34:10 -070069############### Run the host side tests ###############
Kalle Raitaf4a90622015-12-09 13:31:36 -080070${CTS_DIR}/common/host-side/tradefed/tests/run_tests.sh
71${CTS_DIR}/common/host-side/manifest-generator/tests/run_tests.sh
72${CTS_DIR}/common/host-side/util/tests/run_tests.sh
73${CTS_DIR}/common/util/tests/run_tests.sh
Stuart Scottff15fe92015-08-28 15:34:10 -070074
Fang Dengb3729ff2018-05-05 12:53:42 -070075# TODO: Change it to the new harness repo once harness
76# code is moved to its own repo. [fix-harness-dir]
77${CTS_DIR}/harness/tools/cts-tradefed/tests/run_tests.sh