Add intltest and cintltst into postsubmit
am: 3a6ca44eb5
Change-Id: I66d868fdcdf567df399c7f6301d248d6ad7b1e05
diff --git a/TEST_MAPPING b/TEST_MAPPING
new file mode 100644
index 0000000..f394a1f
--- /dev/null
+++ b/TEST_MAPPING
@@ -0,0 +1,10 @@
+{
+ "postsubmit": [
+ {
+ "name": "intltest"
+ },
+ {
+ "name": "cintltst"
+ }
+ ]
+}
diff --git a/icu4c/source/Android.bp b/icu4c/source/Android.bp
index e358c26..d04f7d3 100644
--- a/icu4c/source/Android.bp
+++ b/icu4c/source/Android.bp
@@ -20,13 +20,6 @@
"tools/toolutil",
]
-filegroup {
- name: "icu4c_test_data",
- srcs: [
- "test/testdata/**/*",
- ],
-}
-
cc_library {
name: "libicuuc_stubdata",
host_supported: true,
diff --git a/icu4c/source/test/Android.bp b/icu4c/source/test/Android.bp
index 16c913b..d55a2ca 100644
--- a/icu4c/source/test/Android.bp
+++ b/icu4c/source/test/Android.bp
@@ -43,7 +43,20 @@
"libicutoolutil",
"libandroidicuinit",
],
+ test_suites: [
+ "general-tests",
+ ],
host_required: [
"ICU4CTestRunner",
],
}
+
+genrule {
+ name: "icu4c_test_data",
+ srcs: [
+ "testdata/**/*",
+ ],
+ out: ["icu4c_test_data.zip"],
+ tools: ["soong_zip"],
+ cmd: "$(location soong_zip) -o $(out) -C external/icu/icu4c/source/test/testdata -D external/icu/icu4c/source/test/testdata",
+}
diff --git a/icu4c/source/test/cintltst/Android.bp b/icu4c/source/test/cintltst/Android.bp
index d410c3f..19e0042 100644
--- a/icu4c/source/test/cintltst/Android.bp
+++ b/icu4c/source/test/cintltst/Android.bp
@@ -29,9 +29,11 @@
],
cflags: [
"-DANDROID_LINK_SHARED_ICU4C",
+ // Force the test to use the data file on
"-DANDROID_USE_ICU_REG",
// Disable some file IO tests to workaround test crashing due to missing data files.
"-DUCONFIG_NO_FILE_IO",
+ "-DZERO_EXIT_CODE_FOR_FAILURES",
],
exclude_srcs: [
// Not built directly, but #included from other sources.
diff --git a/icu4c/source/test/cintltst/AndroidTest.xml b/icu4c/source/test/cintltst/AndroidTest.xml
index 47fc1f2..293235b 100644
--- a/icu4c/source/test/cintltst/AndroidTest.xml
+++ b/icu4c/source/test/cintltst/AndroidTest.xml
@@ -14,6 +14,7 @@
limitations under the License.
-->
<configuration description="Config for CTS ICU4C test cases">
+ <option name="test-suite-tag" value="apct" />
<option name="config-descriptor:metadata" key="component" value="icu4c" />
<option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
<option name="config-descriptor:metadata" key="parameter" value="multi_abi" />
@@ -24,7 +25,11 @@
</target_preparer>
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
<option name="cleanup" value="true" />
- <option name="push" value="test->/data/local/tmp/test" />
+ <option name="push" value="icu4c_test_data.zip->/data/local/tmp/icu4c_test_data.zip" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
+ <option name="run-command" value="mkdir -p /data/local/tmp/test/testdata && unzip -o -d /data/local/tmp/test/testdata /data/local/tmp/icu4c_test_data.zip" />
+ <option name="teardown-command" value="rm -r /data/local/tmp/test/testdata" />
</target_preparer>
<test class="com.android.tradefed.testtype.HostTest" >
diff --git a/icu4c/source/test/intltest/Android.bp b/icu4c/source/test/intltest/Android.bp
index bc283e3..1eea94b 100644
--- a/icu4c/source/test/intltest/Android.bp
+++ b/icu4c/source/test/intltest/Android.bp
@@ -30,6 +30,7 @@
"-DANDROID_USE_ICU_REG",
// Needed for char* shift calculation in the test.
"-Wno-string-plus-int",
+ "-DZERO_EXIT_CODE_FOR_FAILURES",
],
srcs: [
"**/*.c",
diff --git a/icu4c/source/test/intltest/AndroidTest.xml b/icu4c/source/test/intltest/AndroidTest.xml
index 28dd667..7d90146 100644
--- a/icu4c/source/test/intltest/AndroidTest.xml
+++ b/icu4c/source/test/intltest/AndroidTest.xml
@@ -14,7 +14,6 @@
limitations under the License.
-->
<configuration description="Config for ICU4C intltest">
- <option name="test-suite-tag" value="intltest" />
<option name="test-suite-tag" value="apct" />
<option name="config-descriptor:metadata" key="component" value="icu4c" />
<option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
@@ -26,7 +25,11 @@
</target_preparer>
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
<option name="cleanup" value="true" />
- <option name="push" value="test->/data/local/tmp/test" />
+ <option name="push" value="icu4c_test_data.zip->/data/local/tmp/icu4c_test_data.zip" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
+ <option name="run-command" value="mkdir -p /data/local/tmp/test/testdata && unzip -o -d /data/local/tmp/test/testdata /data/local/tmp/icu4c_test_data.zip" />
+ <option name="teardown-command" value="rm -r /data/local/tmp/test/testdata" />
</target_preparer>
<test class="com.android.tradefed.testtype.HostTest" >