summaryrefslogtreecommitdiff
path: root/automated/lib
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2016-10-27 18:16:10 +0800
committerChase Qi <chase.qi@linaro.org>2016-10-27 18:16:10 +0800
commit38ea4d3f88337fe36d83e8b61d7496eedcba7d25 (patch)
tree08cc86433368b45088f70109e929a113404f501e /automated/lib
parentc50a99ebb5835501181f4e34417e38fc819a6280 (diff)
v2: sh-test-lib: add detect_abi function
Binaries are placed in folders named with abi. Test script need to detect abi type and use related binary. Change-Id: Id64bb84ba1170a52fdc2f1b485dc46eec1faae3f Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated/lib')
-rwxr-xr-xautomated/lib/sh-test-lib9
1 files changed, 9 insertions, 0 deletions
diff --git a/automated/lib/sh-test-lib b/automated/lib/sh-test-lib
index b0fa164..11873cd 100755
--- a/automated/lib/sh-test-lib
+++ b/automated/lib/sh-test-lib
@@ -95,6 +95,15 @@ add_metric() {
echo "${test} ${result} ${measurement} ${units}" | tee -a "${RESULT_FILE}"
}
+detect_abi() {
+ abi=$(uname -m)
+ case "${abi}" in
+ armv7|armv7l|armv7el|armv7lh) abi="armeabi" ;;
+ arm64|armv8|arm64-v8a|aarch64) abi="arm64" ;;
+ *) error_msg "Unknown architecture: ${abi}" ;;
+ esac
+}
+
dist_name() {
if [ -x /usr/bin/lsb_release ]; then
dist="$(lsb_release -si)"