From 38ea4d3f88337fe36d83e8b61d7496eedcba7d25 Mon Sep 17 00:00:00 2001 From: Chase Qi Date: Thu, 27 Oct 2016 18:16:10 +0800 Subject: 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 --- automated/lib/sh-test-lib | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'automated/lib/sh-test-lib') 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)" -- cgit v1.2.3