Split Wycheproof test cases into two CTS modules.

Because we use test suites to execute the same tests in two different
contexts, CTS gets confused by the two suites living the in the same
module and miscounts the number of tests that are executed.  Splitting
them into different modules allows CTS to distinguish them based on the
module name.

Bug: 38413440
Test: cts -m CtsLibcoreWycheproofConscryptTestCases
Test: cts -m CtsLibcoreWycheproofBCTestCases
Change-Id: If61ecc0297fa84a6ba8f17edd3f3f90463d06cbd
Merged-In: I879a4822f599b51d4442f1f9fb8bf76ef2b89da8
diff --git a/tests/libcore/wycheproof-bc/Android.mk b/tests/libcore/wycheproof-bc/Android.mk
new file mode 100644
index 0000000..3751ac5
--- /dev/null
+++ b/tests/libcore/wycheproof-bc/Android.mk
@@ -0,0 +1,49 @@
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_PACKAGE_NAME := CtsLibcoreWycheproofBCTestCases
+
+LOCAL_STATIC_JAVA_LIBRARIES := \
+    cts-core-test-runner \
+    wycheproof
+
+LOCAL_JAVA_LIBRARIES := bouncycastle
+
+# Don't include this package in any target
+LOCAL_MODULE_TAGS := tests
+
+# When built, explicitly put it in the data partition.
+LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under,src)
+
+LOCAL_DEX_PREOPT := false
+LOCAL_JACK_FLAGS := --multi-dex native
+
+LOCAL_PROGUARD_ENABLED := disabled
+
+# Include both the 32 and 64 bit versions of libjavacoretests,
+# where applicable.
+LOCAL_MULTILIB := both
+
+# Tag this module as a cts test artifact
+LOCAL_COMPATIBILITY_SUITE := cts
+
+LOCAL_JAVA_RESOURCE_FILES := libcore/expectations/knownfailures.txt
+
+include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/tests/libcore/wycheproof-bc/AndroidManifest.xml b/tests/libcore/wycheproof-bc/AndroidManifest.xml
new file mode 100644
index 0000000..15c5fd5
--- /dev/null
+++ b/tests/libcore/wycheproof-bc/AndroidManifest.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="android.libcore.cts.wycheproof.bouncycastle">
+    <uses-permission android:name="android.permission.INTERNET" />
+    <application>
+        <uses-library android:name="android.test.runner" />
+    </application>
+
+    <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
+                     android:targetPackage="android.libcore.cts.wycheproof.bouncycastle"
+                     android:label="CTS Libcore Wycheproof Bouncy Castle test cases" />
+
+</manifest>
diff --git a/tests/libcore/wycheproof-bc/AndroidTest.xml b/tests/libcore/wycheproof-bc/AndroidTest.xml
new file mode 100644
index 0000000..4e9c320
--- /dev/null
+++ b/tests/libcore/wycheproof-bc/AndroidTest.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for CTS Libcore Wycheproof Bouncy Castle test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.ApkInstaller">
+        <option name="cleanup-apks" value="true" />
+        <!-- this has just the instrumentation which acts as the tests we want to run -->
+        <option name="test-file-name" value="CtsLibcoreWycheproofBCTestCases.apk" />
+    </target_preparer>
+    <test class="com.android.compatibility.testtype.LibcoreTest" >
+        <option name="package" value="android.libcore.cts.wycheproof.bouncycastle" />
+        <!-- The individual test cases don't work unless they're run in the
+             context of one of the suites, so we have to limit the test
+             infrastructure to only running the test suites. -->
+        <option name="test-package" value="android.libcore.cts.wycheproof" />
+        <option name="instrumentation-arg" key="listener"
+                value="com.android.cts.runner.CtsTestRunListener" />
+        <option name="instrumentation-arg" key="filter"
+                value="com.android.cts.core.runner.ExpectationBasedFilter" />
+        <option name="core-expectation" value="/knownfailures.txt" />
+        <option name="runtime-hint" value="10m"/>
+    </test>
+</configuration>
diff --git a/tests/libcore/wycheproof/src/android/libcore/cts/wycheproof/BouncyCastleSupportProvider.java b/tests/libcore/wycheproof-bc/src/android/libcore/cts/wycheproof/BouncyCastleSupportProvider.java
similarity index 100%
rename from tests/libcore/wycheproof/src/android/libcore/cts/wycheproof/BouncyCastleSupportProvider.java
rename to tests/libcore/wycheproof-bc/src/android/libcore/cts/wycheproof/BouncyCastleSupportProvider.java
diff --git a/tests/libcore/wycheproof/src/android/libcore/cts/wycheproof/BouncyCastleTest.java b/tests/libcore/wycheproof-bc/src/android/libcore/cts/wycheproof/BouncyCastleTest.java
similarity index 100%
rename from tests/libcore/wycheproof/src/android/libcore/cts/wycheproof/BouncyCastleTest.java
rename to tests/libcore/wycheproof-bc/src/android/libcore/cts/wycheproof/BouncyCastleTest.java
diff --git a/tests/libcore/wycheproof/Android.mk b/tests/libcore/wycheproof/Android.mk
index b92b469..bfcdda5 100644
--- a/tests/libcore/wycheproof/Android.mk
+++ b/tests/libcore/wycheproof/Android.mk
@@ -16,15 +16,13 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_PACKAGE_NAME := CtsLibcoreWycheproofTestCases
+LOCAL_PACKAGE_NAME := CtsLibcoreWycheproofConscryptTestCases
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     cts-core-test-runner \
     wycheproof
 
-LOCAL_JAVA_LIBRARIES := \
-    bouncycastle \
-    conscrypt
+LOCAL_JAVA_LIBRARIES := conscrypt
 
 # Don't include this package in any target
 LOCAL_MODULE_TAGS := tests
diff --git a/tests/libcore/wycheproof/AndroidManifest.xml b/tests/libcore/wycheproof/AndroidManifest.xml
index 09b9da1..765c677 100644
--- a/tests/libcore/wycheproof/AndroidManifest.xml
+++ b/tests/libcore/wycheproof/AndroidManifest.xml
@@ -15,14 +15,14 @@
  * limitations under the License.
  -->
 
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="android.libcore.cts.wycheproof">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="android.libcore.cts.wycheproof.conscrypt">
     <uses-permission android:name="android.permission.INTERNET" />
     <application>
         <uses-library android:name="android.test.runner" />
     </application>
 
     <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
-                     android:targetPackage="android.libcore.cts.wycheproof"
-                     android:label="CTS Libcore Wycheproof test cases" />
+                     android:targetPackage="android.libcore.cts.wycheproof.conscrypt"
+                     android:label="CTS Libcore Wycheproof Conscrypt test cases" />
 
 </manifest>
diff --git a/tests/libcore/wycheproof/AndroidTest.xml b/tests/libcore/wycheproof/AndroidTest.xml
index d4d1c42..bab6eed 100644
--- a/tests/libcore/wycheproof/AndroidTest.xml
+++ b/tests/libcore/wycheproof/AndroidTest.xml
@@ -13,14 +13,14 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="Config for CTS Libcore Wycheproof test cases">
+<configuration description="Config for CTS Libcore Wycheproof Conscrypt test cases">
     <target_preparer class="com.android.compatibility.common.tradefed.targetprep.ApkInstaller">
         <option name="cleanup-apks" value="true" />
         <!-- this has just the instrumentation which acts as the tests we want to run -->
-        <option name="test-file-name" value="CtsLibcoreWycheproofTestCases.apk" />
+        <option name="test-file-name" value="CtsLibcoreWycheproofConscryptTestCases.apk" />
     </target_preparer>
     <test class="com.android.compatibility.testtype.LibcoreTest" >
-        <option name="package" value="android.libcore.cts.wycheproof" />
+        <option name="package" value="android.libcore.cts.wycheproof.conscrypt" />
         <!-- The individual test cases don't work unless they're run in the
              context of one of the suites, so we have to limit the test
              infrastructure to only running the test suites. -->