aboutsummaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2014-08-19 10:37:19 +0800
committerChase Qi <chase.qi@linaro.org>2014-08-19 10:37:19 +0800
commit0ad75facb0635b2a344e06255c4e59602190f1d3 (patch)
tree6ae7713b360707be09ac0e3804e7effab1ff082a /android
parenta09bd2993753517c4aecb428f00d8b985435edfc (diff)
toolchain debug
Diffstat (limited to 'android')
-rwxr-xr-xandroid/scripts/toolchain-android1.sh58
-rwxr-xr-xandroid/scripts/toolchain-android2.sh76
-rw-r--r--android/toolchain-android1.yaml30
-rw-r--r--android/toolchain-android2.yaml30
4 files changed, 194 insertions, 0 deletions
diff --git a/android/scripts/toolchain-android1.sh b/android/scripts/toolchain-android1.sh
new file mode 100755
index 0000000..6997a3d
--- /dev/null
+++ b/android/scripts/toolchain-android1.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+#
+# Device Tree test cases for Linaro Android
+#
+# Copyright (C) 2013, Linaro Limited.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Author: Botao Sun <botao.sun@linaro.org>
+
+function fail_test() {
+ local reason=$1
+ echo "${TEST}: FAIL - ${reason}"
+}
+
+function pass_test() {
+ echo "${TEST}: PASS"
+}
+
+## Test case definitions
+
+# Check if /proc/version and toolchain version not empty
+test_toolchain_not_empty() {
+ TEST="test_toolchain_not_empty"
+
+ if [ ! -f /proc/version ]; then
+ fail_test "Unable to find /proc/version"
+ return 1
+ fi
+
+ version=`grep "Linaro GCC" /proc/version`
+ if [ -z "$version" ]; then
+ fail_test "Empty toolchain description at /proc/version"
+ exit 1
+ fi
+
+ echo "Content of /proc/version: $version"
+
+ pass_test
+}
+
+# run the tests
+test_toolchain_not_empty
+
+# clean exit so lava-test can trust the results
+exit 0
diff --git a/android/scripts/toolchain-android2.sh b/android/scripts/toolchain-android2.sh
new file mode 100755
index 0000000..98f8ea3
--- /dev/null
+++ b/android/scripts/toolchain-android2.sh
@@ -0,0 +1,76 @@
+#!/bin/sh
+#
+# Device Tree test cases for Linaro Android
+#
+# Copyright (C) 2013, Linaro Limited.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Author: Botao Sun <botao.sun@linaro.org>
+
+function fail_test() {
+ local reason=$1
+ echo "${TEST}: FAIL - ${reason}"
+}
+
+function pass_test() {
+ echo "${TEST}: PASS"
+}
+
+## Test case definitions
+
+# Check if toolchain version correct
+test_toolchain_version_measurement() {
+ TEST="test_toolchain_version_measurement"
+ LinaroGCC=`awk '{print substr($12,5,7)}' /proc/version`
+ BuildYear=`awk '{print $22;}' /proc/version`
+ BuildMonth=`awk '{print $18;}' /proc/version`
+ case $BuildMonth in
+ Jan) BuildMonth=01 ;;
+ Feb) BuildMonth=02 ;;
+ Mar) BuildMonth=03 ;;
+ Apr) BuildMonth=04 ;;
+ May) BuildMonth=05 ;;
+ Jun) BuildMonth=06 ;;
+ Jul) BuildMonth=07 ;;
+ Aug) BuildMonth=08 ;;
+ Sep) BuildMonth=09 ;;
+ Oct) BuildMonth=10 ;;
+ Nov) BuildMonth=11 ;;
+ Dec) BuildMonth=12 ;;
+ esac
+ BuildDay=`awk '{print $19;}' /proc/version`
+
+ Measurement=$BuildYear.$BuildMonth
+
+ if [ $BuildDay -ge 16 ]; then
+ if [ "$LinaroGCC" != "$Measurement" ]; then
+ fail_test "Wrong Toolchain version"
+ echo "Toolchain $Measurement should be used after the 16th"
+ echo "Toolchain used for this image: $LinaroGCC"
+ exit 1
+ fi
+ fi
+
+ echo "Correct toolchain used, version: $LinaroGCC"
+ pass_test
+}
+
+# run the tests
+# test_toolchain_not_empty
+test_toolchain_version_measurement
+
+# clean exit so lava-test can trust the results
+exit 0
diff --git a/android/toolchain-android1.yaml b/android/toolchain-android1.yaml
new file mode 100644
index 0000000..902a632
--- /dev/null
+++ b/android/toolchain-android1.yaml
@@ -0,0 +1,30 @@
+metadata:
+ name: toolchain
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "Check if toolchain version correct"
+ os:
+ - android
+ devices:
+ - panda
+ - panda-es
+ - vexpress-a9
+ - vexpress-tc2
+ - highbank
+ - rtsm_foundation-armv8
+ - rtsm_fvp_base-aemv8a
+ - arndale
+ - aa9
+ scope:
+ - functional
+ environment:
+ - lava-test-shell
+
+run:
+ steps:
+ - "./android/scripts/toolchain-android1.sh"
+
+parse:
+ pattern: "(?P<test_case_id>[a-zA-Z0-9_-]+):\\s(?P<result>\\w+)"
+ fixupdict:
+ FAIL: fail
+ PASS: pass
diff --git a/android/toolchain-android2.yaml b/android/toolchain-android2.yaml
new file mode 100644
index 0000000..41cd2d2
--- /dev/null
+++ b/android/toolchain-android2.yaml
@@ -0,0 +1,30 @@
+metadata:
+ name: toolchain
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "Check if toolchain version correct"
+ os:
+ - android
+ devices:
+ - panda
+ - panda-es
+ - vexpress-a9
+ - vexpress-tc2
+ - highbank
+ - rtsm_foundation-armv8
+ - rtsm_fvp_base-aemv8a
+ - arndale
+ - aa9
+ scope:
+ - functional
+ environment:
+ - lava-test-shell
+
+run:
+ steps:
+ - "./android/scripts/toolchain-android2.sh"
+
+parse:
+ pattern: "(?P<test_case_id>[a-zA-Z0-9_-]+):\\s(?P<result>\\w+)"
+ fixupdict:
+ FAIL: fail
+ PASS: pass