Migrate simplecpu tests to cts_v2

bug:21762834
Change-Id: Ibdb67189bb229b581ba6a148aa310704e29b3f11
diff --git a/CtsTestCaseList.mk b/CtsTestCaseList.mk
index 8ae6b23..25d3275 100644
--- a/CtsTestCaseList.mk
+++ b/CtsTestCaseList.mk
@@ -127,7 +127,6 @@
 # Test packages that require an associated test package XML.
 cts_test_packages := \
     CtsIcuTestCases \
-    CtsDeviceSimpleCpu \
     CtsDeviceVideoPerf \
     CtsDeviceTvProviderPerf \
     CtsAccelerationTestCases \
@@ -190,6 +189,7 @@
     CtsSaxTestCases \
     CtsSecurityTestCases \
     CtsSignatureTestCases \
+    CtsSimpleCpuTestCases \
     CtsSpeechTestCases \
     CtsSystemUiTestCases \
     CtsTelecomTestCases \
diff --git a/suite/cts/deviceTests/simplecpu/Android.mk b/tests/simplecpu/Android.mk
similarity index 89%
rename from suite/cts/deviceTests/simplecpu/Android.mk
rename to tests/simplecpu/Android.mk
index 0a0be45..707a380 100644
--- a/suite/cts/deviceTests/simplecpu/Android.mk
+++ b/tests/simplecpu/Android.mk
@@ -27,7 +27,10 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := CtsDeviceSimpleCpu
+LOCAL_PACKAGE_NAME := CtsSimpleCpuTestCases
+
+# Tag this module as a cts_v2 test artifact
+LOCAL_COMPATIBILITY_SUITE := cts_v2
 
 LOCAL_SDK_VERSION := 16
 
diff --git a/suite/cts/deviceTests/simplecpu/AndroidManifest.xml b/tests/simplecpu/AndroidManifest.xml
similarity index 86%
rename from suite/cts/deviceTests/simplecpu/AndroidManifest.xml
rename to tests/simplecpu/AndroidManifest.xml
index e5c1c2b..4b5febf 100644
--- a/suite/cts/deviceTests/simplecpu/AndroidManifest.xml
+++ b/tests/simplecpu/AndroidManifest.xml
@@ -15,7 +15,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-        package="com.android.cts.simplecpu">
+        package="android.simplecpu.cts">
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@@ -24,6 +24,6 @@
         <uses-library android:name="android.test.runner" />
     </application>
     <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
-            android:targetPackage="com.android.cts.simplecpu"
-            android:label="Very simple CPU benchmarking" />
+            android:targetPackage="android.simplecpu.cts"
+            android:label="CTS tests for simple CPU" />
 </manifest>
diff --git a/tests/simplecpu/AndroidTest.xml b/tests/simplecpu/AndroidTest.xml
new file mode 100644
index 0000000..e514a9c
--- /dev/null
+++ b/tests/simplecpu/AndroidTest.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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 File System test cases">
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.ApkInstaller">
+        <option name="cleanup-apks" value="true" />
+        <option name="test-file-name" value="CtsSimpleCpuTestCases.apk" />
+    </target_preparer>
+    <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
+        <option name="package" value="android.simplecpu.cts" />
+    </test>
+</configuration>
diff --git a/suite/cts/deviceTests/simplecpu/jni/Android.mk b/tests/simplecpu/jni/Android.mk
similarity index 100%
rename from suite/cts/deviceTests/simplecpu/jni/Android.mk
rename to tests/simplecpu/jni/Android.mk
diff --git a/suite/cts/deviceTests/simplecpu/jni/CpuNativeJni.cpp b/tests/simplecpu/jni/CpuNativeJni.cpp
similarity index 97%
rename from suite/cts/deviceTests/simplecpu/jni/CpuNativeJni.cpp
rename to tests/simplecpu/jni/CpuNativeJni.cpp
index e0be7f3..4ea0dc0 100644
--- a/suite/cts/deviceTests/simplecpu/jni/CpuNativeJni.cpp
+++ b/tests/simplecpu/jni/CpuNativeJni.cpp
@@ -182,7 +182,7 @@
     return *(int*)p1 - *(int*)p2;
 }
 
-extern "C" JNIEXPORT jdouble JNICALL Java_com_android_cts_simplecpu_CpuNative_runSort(JNIEnv* env,
+extern "C" JNIEXPORT jdouble JNICALL Java_android_simplecpu_cts_CpuNative_runSort(JNIEnv* env,
         jclass clazz, jint numberElements, jint repetition)
 {
     int* data = new int[numberElements];
@@ -239,7 +239,7 @@
     }
 }
 
-extern "C" JNIEXPORT jdouble JNICALL Java_com_android_cts_simplecpu_CpuNative_runMatrixMultiplication(
+extern "C" JNIEXPORT jdouble JNICALL Java_android_simplecpu_cts_CpuNative_runMatrixMultiplication(
         JNIEnv* env, jclass clazz, jint n, jint repetition)
 {
     // C = A x B
diff --git a/suite/cts/deviceTests/simplecpu/src/com/android/cts/simplecpu/CpuNative.java b/tests/simplecpu/src/android/simplecpu/cts/CpuNative.java
similarity index 96%
rename from suite/cts/deviceTests/simplecpu/src/com/android/cts/simplecpu/CpuNative.java
rename to tests/simplecpu/src/android/simplecpu/cts/CpuNative.java
index 8b48623..231cba6 100644
--- a/suite/cts/deviceTests/simplecpu/src/com/android/cts/simplecpu/CpuNative.java
+++ b/tests/simplecpu/src/android/simplecpu/cts/CpuNative.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.cts.simplecpu;
+package android.simplecpu.cts;
 
 public class CpuNative {
     static {
diff --git a/suite/cts/deviceTests/simplecpu/src/com/android/cts/simplecpu/SimpleCpuTest.java b/tests/simplecpu/src/android/simplecpu/cts/SimpleCpuTest.java
similarity index 98%
rename from suite/cts/deviceTests/simplecpu/src/com/android/cts/simplecpu/SimpleCpuTest.java
rename to tests/simplecpu/src/android/simplecpu/cts/SimpleCpuTest.java
index 520ae79..fa7f402 100644
--- a/suite/cts/deviceTests/simplecpu/src/com/android/cts/simplecpu/SimpleCpuTest.java
+++ b/tests/simplecpu/src/android/simplecpu/cts/SimpleCpuTest.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.cts.simplecpu;
+package android.simplecpu.cts;
 
 import android.cts.util.CtsAndroidTestCase;
 import android.util.Log;
diff --git a/tools/utils/buildCts.py b/tools/utils/buildCts.py
index 8bfdc32..235e7fc 100755
--- a/tools/utils/buildCts.py
+++ b/tools/utils/buildCts.py
@@ -363,6 +363,7 @@
       'android.rsg' : [],
       'android.sax' : [],
       'android.signature' : [],
+      'android.simplecpu' : [],
       'android.speech' : [],
       'android.tests.appsecurity' : [],
       'android.text' : [],
@@ -373,7 +374,6 @@
       'com.android.cts.jank' : [],
       'com.android.cts.jank2' : [],
       'com.android.cts.opengl' : [],
-      'com.android.cts.simplecpu' : [],
       'com.android.cts.ui' : [],
       'com.android.cts.uihost' : [],
       'com.android.cts.videoperf' : [],