summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2014-10-15 18:08:41 -0700
committerThe Android Automerger <android-build@google.com>2014-10-16 15:34:20 -0700
commit10ea501cd22e8057b376419bd0cbffb52feeb3b5 (patch)
treeedb59a698a6ca0e6d86ea7f10700119b123aae29
parent6b7e1ba9c07909f871f4161ea3f43267af44cd69 (diff)
downloadplatform_cts-10ea501cd22e8057b376419bd0cbffb52feeb3b5.tar.gz
platform_cts-10ea501cd22e8057b376419bd0cbffb52feeb3b5.tar.bz2
platform_cts-10ea501cd22e8057b376419bd0cbffb52feeb3b5.zip
Add cts native test multilib support.
- Add support for marking a single test as not supported by an abi. - Add four bionic tests that do not run on 64 bit abis. - Make all native test executables end in 32/64 depending on the abi. - For 64 bit abis, force the inclusion of the 64 bit test executable. - Modify the native gtest runner to append 32/64 to the executable depending on the bitness of the abi. Bug: 17927956 Change-Id: Ie36a189f65c901b16041e4e7db8d806480a9861a
-rw-r--r--CtsBuild.mk2
-rw-r--r--CtsTestCaseList.mk23
-rw-r--r--tests/expectations/unsupportedabis.txt4
-rw-r--r--tests/tests/bionic/Android.mk7
-rw-r--r--tests/tests/nativemedia/sl/Android.mk3
-rw-r--r--tests/tests/nativemedia/xa/Android.mk3
-rw-r--r--tools/cts-xml-generator/src/com/android/cts/xmlgenerator/XmlGenerator.java44
-rw-r--r--tools/tradefed-host/src/com/android/cts/tradefed/testtype/GeeTest.java3
8 files changed, 67 insertions, 22 deletions
diff --git a/CtsBuild.mk b/CtsBuild.mk
index 12a90473cce..dbe93c780e9 100644
--- a/CtsBuild.mk
+++ b/CtsBuild.mk
@@ -47,7 +47,7 @@ define cts-get-ui-lib-paths
endef
define cts-get-native-paths
- $(foreach exe,$(1),$(call intermediates-dir-for,EXECUTABLES,$(exe))/$(exe))
+ $(foreach exe,$(1),$(call intermediates-dir-for,EXECUTABLES,$(exe),,,$(3))/$(exe)$(2))
endef
define cts-get-package-paths
diff --git a/CtsTestCaseList.mk b/CtsTestCaseList.mk
index 2011b18519c..a31014db34a 100644
--- a/CtsTestCaseList.mk
+++ b/CtsTestCaseList.mk
@@ -178,13 +178,16 @@ cts_host_libraries := \
CtsSecurityHostTestCases \
CtsUsbTests
-# Native test executables that need to have associated test XMLs.
-cts_native_exes := \
+# List of native tests. For 32 bit targets, assumes that there will be
+# one test executable, and it will end in 32. For 64 bit targets, assumes
+# that there will be two executables, one that ends in 32 for the 32
+# bit executable and one that ends in 64 for the 64 bit executable.
+cts_native_tests := \
NativeMediaTest_SL \
NativeMediaTest_XA \
ifeq ($(HOST_OS)-$(HOST_ARCH),$(filter $(HOST_OS)-$(HOST_ARCH),linux-x86 linux-x86_64))
-cts_native_exes += bionic-unit-tests-cts
+cts_native_tests += bionic-unit-tests-cts
endif
cts_ui_tests := \
@@ -208,17 +211,27 @@ cts_deqp_test_apis := \
# directory of the final CTS distribution.
CTS_TEST_CASES := $(call cts-get-lib-paths,$(cts_host_libraries)) \
$(call cts-get-package-paths,$(cts_test_packages)) \
- $(call cts-get-native-paths,$(cts_native_exes)) \
$(call cts-get-ui-lib-paths,$(cts_ui_tests)) \
$(call cts-get-ui-lib-paths,$(cts_device_jars)) \
$(call cts-get-ui-lib-paths,$(cts_target_junit_tests)) \
$(call cts-get-executable-paths,$(cts_device_executables))
+# NOTE: If compiling on a 64 bit target, TARGET_2ND_ARCH will be non-empty
+# and will cause the function to expand to the secondary arch object
+# directory. If compiling on a 32 bit target, TARGET_2ND_ARCH will be
+# empty and will cause the function to expand to the primary arch object
+# directory.
+CTS_TEST_CASES += $(call cts-get-native-paths,$(cts_native_tests),32,$(TARGET_2ND_ARCH))
+
+ifeq ($(TARGET_IS_64_BIT),true)
+CTS_TEST_CASES += $(call cts-get-native-paths,$(cts_native_tests),64)
+endif
+
# All the XMLs that will end up under the repository/testcases
# and that need to be created before making the final CTS distribution.
CTS_TEST_XMLS := $(call cts-get-test-xmls,$(cts_host_libraries)) \
$(call cts-get-test-xmls,$(cts_test_packages)) \
- $(call cts-get-test-xmls,$(cts_native_exes)) \
+ $(call cts-get-test-xmls,$(cts_native_tests)) \
$(call cts-get-test-xmls,$(cts_target_junit_tests)) \
$(call cts-get-test-xmls,$(cts_ui_tests)) \
$(call cts-get-deqp-test-xmls,$(cts_deqp_test_apis))
diff --git a/tests/expectations/unsupportedabis.txt b/tests/expectations/unsupportedabis.txt
index 520d750c18d..19a94a815f3 100644
--- a/tests/expectations/unsupportedabis.txt
+++ b/tests/expectations/unsupportedabis.txt
@@ -2,6 +2,10 @@
{
description: "Tests not supporting: arm64-v8a, x86_64, mips64",
names: [
+ "android.bionic.malloc#pvalloc_overflow",
+ "android.bionic.malloc#pvalloc_std",
+ "android.bionic.malloc#valloc_overflow",
+ "android.bionic.malloc#valloc_std",
"android.sample.cts.SampleDeviceResultTest",
"android.sample.cts.SampleDeviceTest",
"android.sample.cts.SampleHostResultTest",
diff --git a/tests/tests/bionic/Android.mk b/tests/tests/bionic/Android.mk
index 1a048c60918..e1afd504cf8 100644
--- a/tests/tests/bionic/Android.mk
+++ b/tests/tests/bionic/Android.mk
@@ -8,6 +8,9 @@ include $(CLEAR_VARS)
LOCAL_MODULE := $(test_executable)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativetest
+LOCAL_MULTILIB := both
+LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
+LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
LOCAL_ADDITION_DEPENDENCIES := \
$(LOCAL_PATH)/Android.mk \
@@ -31,6 +34,10 @@ include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := $(list_executable)
+LOCAL_MULTILIB := both
+# Use the 32 bit list executable since it will include some 32 bit only tests.
+LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)
+LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
LOCAL_ADDITION_DEPENDENCIES := \
$(LOCAL_PATH)/Android.mk \
diff --git a/tests/tests/nativemedia/sl/Android.mk b/tests/tests/nativemedia/sl/Android.mk
index 5b34b3d6db1..48b816c8e3f 100644
--- a/tests/tests/nativemedia/sl/Android.mk
+++ b/tests/tests/nativemedia/sl/Android.mk
@@ -10,6 +10,9 @@ include $(CLEAR_VARS)
LOCAL_MODULE := $(test_executable)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativetest
+LOCAL_MULTILIB := both
+LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
+LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
LOCAL_C_INCLUDES := \
bionic \
diff --git a/tests/tests/nativemedia/xa/Android.mk b/tests/tests/nativemedia/xa/Android.mk
index 6995bc0e09d..ace315a4fa7 100644
--- a/tests/tests/nativemedia/xa/Android.mk
+++ b/tests/tests/nativemedia/xa/Android.mk
@@ -10,6 +10,9 @@ include $(CLEAR_VARS)
LOCAL_MODULE:= $(test_executable)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativetest
+LOCAL_MULTILIB := both
+LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
+LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
LOCAL_C_INCLUDES := \
bionic \
diff --git a/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/XmlGenerator.java b/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/XmlGenerator.java
index 1680caee777..833bf698a48 100644
--- a/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/XmlGenerator.java
+++ b/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/XmlGenerator.java
@@ -205,7 +205,8 @@ class XmlGenerator {
String className = nameCollector.toString();
nameCollector.append('#').append(test.getName());
writer.append("<Test name=\"").append(test.getName()).append("\"");
- String abis = getSupportedAbis(mUnsupportedAbis, mArchitecture, className).toString();
+ String abis = getSupportedAbis(mUnsupportedAbis, mArchitecture,
+ className, nameCollector.toString()).toString();
writer.append(" abis=\"" + abis.substring(1, abis.length() - 1) + "\"");
if (isKnownFailure(mKnownFailures, nameCollector.toString())) {
writer.append(" expectation=\"failure\"");
@@ -232,23 +233,36 @@ class XmlGenerator {
// Returns the list of ABIs supported by this TestCase on this architecture.
public static Set<String> getSupportedAbis(ExpectationStore expectationStore,
- String architecture, String className) {
+ String architecture, String className, String testName) {
Set<String> supportedAbis = AbiUtils.getAbisForArch(architecture);
- Expectation e = (expectationStore == null) ? null : expectationStore.get(className);
- if (e != null && !e.getDescription().isEmpty()) {
- // Description should be written in the form "blah blah: abi1, abi2..."
- String description = e.getDescription().split(":")[1];
- String[] unsupportedAbis = description.split(",");
- for (String a : unsupportedAbis) {
- String abi = a.trim();
- if (!AbiUtils.isAbiSupportedByCts(abi)) {
- throw new RuntimeException(
- String.format("Unrecognised ABI %s in %s", abi, e.getDescription()));
- }
- supportedAbis.remove(abi);
- }
+ if (expectationStore == null) {
+ return supportedAbis;
}
+
+ removeUnsupportedAbis(expectationStore.get(className), supportedAbis);
+ removeUnsupportedAbis(expectationStore.get(testName), supportedAbis);
return supportedAbis;
}
+ public static void removeUnsupportedAbis(Expectation expectation, Set<String> supportedAbis) {
+ if (expectation == null) {
+ return;
+ }
+
+ String description = expectation.getDescription();
+ if (description.isEmpty()) {
+ return;
+ }
+
+ String[] unsupportedAbis = description.split(":")[1].split(",");
+ for (String a : unsupportedAbis) {
+ String abi = a.trim();
+ if (!AbiUtils.isAbiSupportedByCts(abi)) {
+ throw new RuntimeException(
+ String.format("Unrecognised ABI %s in %s", abi, description));
+ }
+ supportedAbis.remove(abi);
+ }
+ }
+
}
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/GeeTest.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/GeeTest.java
index 9bfe1518170..6c2ed65767f 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/GeeTest.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/GeeTest.java
@@ -49,9 +49,9 @@ public class GeeTest implements IBuildReceiver, IDeviceTest, IRemoteTest {
private CtsBuildHelper mCtsBuild;
private ITestDevice mDevice;
private IAbi mAbi;
+ private String mExeName;
private final String mPackageName;
- private final String mExeName;
public GeeTest(String packageName, String exeName) {
mPackageName = packageName;
@@ -63,6 +63,7 @@ public class GeeTest implements IBuildReceiver, IDeviceTest, IRemoteTest {
*/
public void setAbi(IAbi abi) {
mAbi = abi;
+ mExeName += mAbi.getBitness();
}
@Override