Expand the number of signature tests
Replaces CtsApiSignatureTestCases which tests whether the runtime seen
by an app that has <uses-library android:name="android.test.runner"/> in
its manifest provides the API in frameworks/bases/api/current.txt with a
number of tests that test different app configurations.
CtsCurrentApiSignatureTestCases
tests that an app that is targeted at the current API level and does
not have any <uses-library> entries in its manifest can access the
API described in frameworks/base/api/current.txt - excluding APIs
provided by the android.test.runner and android.test.mock libraries.
CtsSystemCurrentApiSignatureTestCases
tests that an app that is targeted at the current API level and does
not have any <uses-library> entries in its manifest can access the
API described in frameworks/base/api/system-current.txt - excluding
APIs provided by the android.test.runner and android.test.mock
libraries.
CtsAndroidTestMockCurrentApiSignatureTestCases
tests that an app that is targeted at the current API level and has
<uses-library android:name="android.test.mock"/> in its manifest can
access the API described in
frameworks/base/test-runner/api/android-test-mock-current.txt.
CtsAndroidTestRunnerCurrentApiSignatureTestCases
tests that an app that is targeted at the current API level and has
<uses-library android:name="android.test.runner"/> in its manifest
can access the API described in
frameworks/base/test-runner/api/android-test-runner-current.txt and
in frameworks/base/test-runner/api/android-test-mock-current.txt.
CtsLegacyTest26ApiSignatureTestCases
tests that an app that is targeted at API level 26 can access the
API described in
frameworks/base/legacy-test/api/legacy-test-current.txt.
Adds tests/signature/runSignatureTests.sh to run the above tests.
The rest of the changes are made to support the above tests:
* Changes SignatureTest and other Java files to support providing an API
description file containing classes that are not expected to be
accessible to the application. This is used to ensure that optional
classes are not visible unless specifically requested.
* Generates additional *.api files for use by the above tests.
* Refactors the makefiles for generating *.api files and building test
APKs to extract the common behavior into separate reusable *.mk files
to reduce duplication.
Bug: 35192974
Bug: 30188076
Test: ran tests/signature/runSignatureTests.sh
Change-Id: Ibb178052a6098e4b42921067ae8ec86d6e7cb379
diff --git a/tests/signature/api-check/Android.mk b/tests/signature/api-check/Android.mk
index 932753c..013cc4d 100644
--- a/tests/signature/api-check/Android.mk
+++ b/tests/signature/api-check/Android.mk
@@ -12,7 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-LOCAL_PATH:= $(call my-dir)
+LOCAL_PATH := $(call my-dir)
+
+# cts-api-signature-test java library
+# ===================================
+
include $(CLEAR_VARS)
# don't include this package in any target
@@ -20,10 +24,7 @@
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_PACKAGE_NAME := CtsApiSignatureTestCases
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
+LOCAL_MODULE := cts-api-signature-test
LOCAL_SDK_VERSION := current
@@ -32,4 +33,6 @@
repackaged-legacy-test \
repackaged.android.test.runner \
-include $(BUILD_CTS_PACKAGE)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))