blob: 64ecf258e49a051bd72a403633d518ae5697aa87 [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
47 compatibility-host-media-preconditions-tests\
48 CompatibilityTestApp"
Stuart Scotte1cd40d2015-10-15 12:16:11 -070049
Kalle Raitaf4a90622015-12-09 13:31:36 -080050pushd ${CTS_DIR}/..
51make ${BUILD_TARGETS} -j32
52BUILD_STATUS=$?
53popd
54if [ "${BUILD_STATUS}" != "0" ]; then
55 echo "BUILD FAILED - EXIT"
56 exit 1;
57fi;
Stuart Scottb9a5c842015-04-23 14:41:29 -070058
Stuart Scott76f0d6d2015-06-02 08:13:27 -070059
Kalle Raitaf4a90622015-12-09 13:31:36 -080060echo
61echo "---- DEVICE-SIDE TESTS ---- "
62echo
63
64${CTS_DIR}/common/device-side/test-app/run_tests.sh
65
66echo
67echo "---- HOST TESTS ---- "
68echo
Stuart Scott76f0d6d2015-06-02 08:13:27 -070069
Stuart Scottff15fe92015-08-28 15:34:10 -070070############### Run the host side tests ###############
Kalle Raitaf4a90622015-12-09 13:31:36 -080071${CTS_DIR}/common/host-side/tradefed/tests/run_tests.sh
72${CTS_DIR}/common/host-side/manifest-generator/tests/run_tests.sh
73${CTS_DIR}/common/host-side/util/tests/run_tests.sh
74${CTS_DIR}/common/util/tests/run_tests.sh
Stuart Scottff15fe92015-08-28 15:34:10 -070075
Kalle Raitaf4a90622015-12-09 13:31:36 -080076${CTS_DIR}/tools/cts-tradefed/tests/run_tests.sh
Stuart Scottff15fe92015-08-28 15:34:10 -070077
Kalle Raitaf4a90622015-12-09 13:31:36 -080078${CTS_DIR}/tests/tests/mediastress/preconditions/tests/run_tests.sh