summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilosz Wasilewski <milosz.wasilewski@linaro.org>2017-05-12 12:52:22 +0000
committerLinaro Code Review <review@review.linaro.org>2017-05-12 12:52:22 +0000
commitdaec34dad7e701c5f92c7fb19b73f07ae68c7028 (patch)
tree428b1612fbd8dbf41c516f0be47c0114e2e52720
parentdcce9e311aefd77ec481f1b8884f8dd6fa67e491 (diff)
parentc1b906184e247b8ce7789e31092facc6ab1ec32a (diff)
Merge "automated: android: add lapack test"
-rwxr-xr-xautomated/linux/lapack/lapack.sh94
-rw-r--r--automated/linux/lapack/lapack.yaml31
2 files changed, 125 insertions, 0 deletions
diff --git a/automated/linux/lapack/lapack.sh b/automated/linux/lapack/lapack.sh
new file mode 100755
index 0000000..6cb717e
--- /dev/null
+++ b/automated/linux/lapack/lapack.sh
@@ -0,0 +1,94 @@
+#!/bin/sh
+
+# shellcheck disable=SC1091
+. ../../lib/sh-test-lib
+
+OUTPUT="$(pwd)/output"
+RESULT_FILE="${OUTPUT}/result.txt"
+RESULT_LOG="${OUTPUT}/result_log.txt"
+TEST_PASS_LOG="${OUTPUT}/test_pass_log.txt"
+TEST_FAIL_LOG="${OUTPUT}/test_fail_log.txt"
+TEST_SKIP_LOG="${OUTPUT}/test_skip_log.txt"
+
+usage() {
+ echo "Usage: $0 [-s <true|false>]" 1>&2
+ exit 1
+}
+
+while getopts "s:h" o; do
+ case "$o" in
+ s) SKIP_INSTALL="${OPTARG}" ;;
+ h|*) usage ;;
+ esac
+done
+
+parse_output() {
+ # Parse each type of results
+ egrep "passed" "${RESULT_LOG}" | tee -a "${TEST_PASS_LOG}"
+ sed -i -e 's/: /:/g' "${TEST_PASS_LOG}"
+ sed -i -e 's/ \+/-/g' "${TEST_PASS_LOG}"
+ sed -i -e 's/-passed:/ pass /g' "${TEST_PASS_LOG}"
+ cat "${TEST_PASS_LOG}" >> "${RESULT_FILE}"
+
+ egrep "failing" "${RESULT_LOG}" | tee -a "${TEST_FAIL_LOG}"
+ sed -i -e 's/failing to pass the threshold:/FAIL:/g' "${TEST_FAIL_LOG}"
+ sed -i -e 's/: /:/g' "${TEST_FAIL_LOG}"
+ sed -i -e 's/ \+/-/g' "${TEST_FAIL_LOG}"
+ sed -i -e 's/-FAIL:/ fail /g' "${TEST_FAIL_LOG}"
+ cat "${TEST_FAIL_LOG}" >> "${RESULT_FILE}"
+
+ egrep "Illegal Error:" "${RESULT_LOG}" | tee -a "${TEST_SKIP_LOG}"
+ egrep "Info Error:" "${RESULT_LOG}" | tee -a "${TEST_SKIP_LOG}"
+ sed -i -e 's/Illegal Error:/SKIP:/g' "${TEST_SKIP_LOG}"
+ sed -i -e 's/Info Error:/SKIP:/g' "${TEST_SKIP_LOG}"
+ sed -i -e 's/: /:/g' "${TEST_SKIP_LOG}"
+ sed -i -e 's/ \+/-/g' "${TEST_SKIP_LOG}"
+ sed -i -e 's/-SKIP:/ skip /g' "${TEST_SKIP_LOG}"
+ cat "${TEST_SKIP_LOG}" >> "${RESULT_FILE}"
+
+ rm -rf "${RESULT_LOG}" "${TEST_PASS_LOG}" "${TEST_FAIL_LOG}" "${TEST_SKIP_LOG}"
+}
+
+lapack_build_test() {
+ git clone https://git.linaro.org/qa/lapack.git
+ # shellcheck disable=SC2164
+ cd lapack
+ cp make.inc.example make.inc
+ # shellcheck disable=SC2039
+ ulimit -s 100000
+ make blaslib
+ make | tee -a "${RESULT_LOG}"
+}
+
+install() {
+ dist_name
+ # shellcheck disable=SC2154
+ case "${dist}" in
+ debian|ubuntu)
+ pkgs="binutils gcc make python sed tar wget gfortran"
+ install_deps "${pkgs}" "${SKIP_INSTALL}"
+ ;;
+ fedora|centos)
+ pkgs="binutils gcc glibc-static make python sed tar wget gfortran"
+ install_deps "${pkgs}" "${SKIP_INSTALL}"
+ ;;
+ esac
+}
+
+# Test run.
+! check_root && error_msg "This script must be run as root"
+create_out_dir "${OUTPUT}"
+# shellcheck disable=SC2164
+cd "${OUTPUT}"
+
+info_msg "About to run lapack test..."
+info_msg "Output directory: ${OUTPUT}"
+
+# Install packages
+install
+
+# Build lapack tests
+lapack_build_test
+
+# Parse and print lapack tests results
+parse_output
diff --git a/automated/linux/lapack/lapack.yaml b/automated/linux/lapack/lapack.yaml
new file mode 100644
index 0000000..70743d1
--- /dev/null
+++ b/automated/linux/lapack/lapack.yaml
@@ -0,0 +1,31 @@
+metadata:
+ name: lapack
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "Build and run lapack (Linear Algebra PACKage) tests natively"
+
+ maintainer:
+ - naresh.kamboju@linaro.org
+ os:
+ - debian
+ - ubuntu
+ - centos
+ - fedora
+ scope:
+ - functional
+ devices:
+ - arndale
+ - mustang
+ - overdrive
+ - d05
+ - d03
+ - hi6220-hikey
+ - apq8016-sbc
+
+params:
+ SKIP_INSTALL: "False"
+
+run:
+ steps:
+ - cd ./automated/linux/lapack/
+ - ./lapack.sh -s "${SKIP_INSTALL}"
+ - ../../utils/send-to-lava.sh ./output/result.txt