1#! /bin/bash
2#
3# Copyright 2017 The Android Open Source Project.
4#
5# Builds and runs signature APK tests.
6
7set -e
8
9if [ -z "$ANDROID_BUILD_TOP" ]; then
10    echo "Missing environment variables. Did you run build/envsetup.sh and lunch?" >&2
11    exit 1
12fi
13
14if [ $# -eq 0 ]; then
15    PACKAGES="
16CtsCurrentApiSignatureTestCases
17CtsSystemApiSignatureTestCases
18CtsAndroidTestMockCurrentApiSignatureTestCases
19CtsAndroidTestRunnerCurrentApiSignatureTestCases
20CtsAndroidTestBase27ApiSignatureTestCases
21
22CtsApacheHttpLegacy27ApiSignatureTestCases
23CtsApacheHttpLegacyCurrentApiSignatureTestCases
24CtsApacheHttpLegacyUsesLibraryApiSignatureTestCases
25
26CtsSystemApiAnnotationTestCases
27
28CtsHiddenApiBlacklistCurrentApiTestCases
29CtsHiddenApiBlacklistApi27TestCases
30CtsHiddenApiBlacklistDebugClassTestCases
31
32CtsHiddenApiKillswitchWildcardTestCases
33CtsHiddenApiKillswitchWhitelistTestCases
34CtsHiddenApiKillswitchDebugClassTestCases
35"
36else
37    PACKAGES=${1+"$@"}
38fi
39
40cd $ANDROID_BUILD_TOP
41make -j32 $PACKAGES
42
43TMPFILE=$(mktemp)
44trap "echo Removing temporary directory; rm -f $TMPFILE" EXIT
45
46for p in $PACKAGES
47do
48    echo cts -a arm64-v8a -m "$p" >> $TMPFILE
49done
50
51cts-tradefed run cmdfileAndExit $TMPFILE
52