aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2019-12-19 17:24:06 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2019-12-19 17:24:06 +0000
commit62fcd6bfe4b1404f61ea37c8c9ef30a922a9e258 (patch)
tree0d1d5e008555d126694fd67aee6ee065724d4d2a
parent34cccfb7b2c62ccec525142fd1b9aba46e20e916 (diff)
parentd01a95fa10bca1e870ed48d3ea40fa56070e704b (diff)
downloadarm-optimized-routines-62fcd6bfe4b1404f61ea37c8c9ef30a922a9e258.tar.gz
arm-optimized-routines: build and run the tests. am: 3eae8e0a7e am: d01a95fa10
Change-Id: I9397b977f0cf1cac064b4656db08f9e92db4e1db
-rwxr-xr-xAndroid.bp46
-rw-r--r--arm-optimized-routines-tests.xml26
-rwxr-xr-xrun-arm-optimized-routines-tests-on-android.sh49
3 files changed, 111 insertions, 10 deletions
diff --git a/Android.bp b/Android.bp
index b0612a8..5628f64 100755
--- a/Android.bp
+++ b/Android.bp
@@ -1,8 +1,6 @@
-cc_library {
- name: "libarm-optimized-routines",
+cc_defaults {
+ name: "arm-optimized-routines-defaults",
host_supported: true,
- recovery_available: true,
- native_bridge_supported: true,
cflags: [
"-Werror",
"-Wno-unused-parameter",
@@ -12,10 +10,19 @@ cc_library {
"-D__BIONIC_LP32_USE_LONG_DOUBLE",
"-DWANT_ROUNDING=0",
"-DWANT_ERRNO=0",
+ "-DWANT_VMATH=0",
"-DFLT_EVAL_METHOD=0",
"-ffp-contract=fast",
+ "-fno-math-errno",
],
local_include_dirs: ["math/include"],
+}
+
+cc_library {
+ name: "libarm-optimized-routines",
+ defaults: ["arm-optimized-routines-defaults"],
+ recovery_available: true,
+ native_bridge_supported: true,
srcs: [
"math/*.c",
],
@@ -47,14 +54,11 @@ cc_library {
// adb shell "/data/nativetest/mathtest/mathtest /data/nativetest/mathtest/test/testcases/directed/*"
cc_test {
name: "mathtest",
+ defaults: ["arm-optimized-routines-defaults"],
gtest: false,
- host_supported: true,
- cflags: ["-Werror", "-Wno-missing-braces"],
- srcs: [
- "math/test/mathtest.c"
- ],
+ cflags: ["-Wno-missing-braces"],
+ srcs: ["math/test/mathtest.c"],
data: ["math/test/testcases/directed/*.tst"],
- local_include_dirs: ["math/include"],
target: {
darwin: {
enabled: false,
@@ -64,3 +68,25 @@ cc_test {
},
},
}
+
+cc_test {
+ name: "ulp",
+ defaults: ["arm-optimized-routines-defaults"],
+ gtest: false,
+ srcs: ["math/test/ulp.c"],
+ data: ["math/test/runulp.sh"],
+}
+
+sh_test {
+ name: "arm-optimized-routines-tests",
+ src: "run-arm-optimized-routines-tests-on-android.sh",
+ filename: "run-arm-optimized-routines-tests-on-android.sh",
+ test_suites: ["general-tests"],
+ host_supported: true,
+ device_supported: false,
+ test_config: "arm-optimized-routines-tests.xml",
+ target_required: [
+ "mathtest",
+ "ulp",
+ ],
+}
diff --git a/arm-optimized-routines-tests.xml b/arm-optimized-routines-tests.xml
new file mode 100644
index 0000000..96db90c
--- /dev/null
+++ b/arm-optimized-routines-tests.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 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 running arm-optimized-routines-tests through Atest or in Infra">
+ <option name="test-suite-tag" value="arm-optimized-routines-tests" />
+ <!-- This test requires a device, so it's not annotated with a null-device. -->
+ <test class="com.android.tradefed.testtype.binary.ExecutableHostTest" >
+ <option name="binary" value="run-arm-optimized-routines-tests-on-android.sh" />
+ <!-- Test script assumes a relative path with the tests/ folders. -->
+ <option name="relative-path-execution" value="true" />
+ <!-- Tests shouldn't be that long but set 15m to be safe. -->
+ <option name="per-binary-timeout" value="15m" />
+ </test>
+</configuration>
diff --git a/run-arm-optimized-routines-tests-on-android.sh b/run-arm-optimized-routines-tests-on-android.sh
new file mode 100755
index 0000000..61efeaf
--- /dev/null
+++ b/run-arm-optimized-routines-tests-on-android.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+# Copy the tests across.
+adb sync
+
+if tty -s; then
+ green="\033[1;32m"
+ red="\033[1;31m"
+ plain="\033[0m"
+else
+ green=""
+ red=""
+ plain=""
+fi
+
+failures=0
+
+check_failure() {
+ if [ $? -eq 0 ]; then
+ echo -e "${green}[PASS]${plain}"
+ else
+ failures=$(($failures+1))
+ echo -e "${red}[FAIL]${plain}"
+ fi
+}
+
+# Run the 32-bit tests.
+adb shell /data/nativetest/mathtest/mathtest /data/nativetest/mathtest/math/test/testcases/directed/*
+check_failure
+
+# TODO: these tests are currently a bloodbath.
+#adb shell 'cp /data/nativetest/ulp/math/test/runulp.sh /data/nativetest/ulp/ && sh /data/nativetest/ulp/runulp.sh'
+#check_failure
+
+# Run the 64-bit tests.
+adb shell /data/nativetest64/mathtest/mathtest /data/nativetest64/mathtest/math/test/testcases/directed/*
+check_failure
+
+# TODO: these tests are currently a bloodbath.
+#adb shell 'cp /data/nativetest64/ulp/math/test/runulp.sh /data/nativetest64/ulp/ && sh /data/nativetest64/ulp/runulp.sh'
+#check_failure
+
+echo
+echo "_________________________________________________________________________"
+echo
+if [ $failures -ne 0 ]; then
+ echo -e "${red}FAILED${plain}: $failures"
+fi
+exit $failures