summaryrefslogtreecommitdiff
path: root/common/scripts
diff options
context:
space:
mode:
authorNaresh Kamboju <naresh.kamboju@linaro.org>2014-12-11 12:32:43 +0530
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2014-12-15 18:09:09 +0000
commitfa7808b12e4c89f30e0b4c7b935b956da48e2fb1 (patch)
tree0228ed5a966ac7cdc14c86e59b2747e4bc25fd9c /common/scripts
parent66a9c0175747f6b172b977a6e8cd9edece623c38 (diff)
dt-selftests: Adding Device Tree Runtime self tests
Adding Device Tree Runtime self tests CONFIG_OF_SELFTEST=y or new version of it CONFIG_OF_UNITTEST=y kernel config required for this tests. Change-Id: Ifdbed87ebe740041252cc751b6bc9ba73b2fa29d Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Diffstat (limited to 'common/scripts')
-rwxr-xr-xcommon/scripts/dt-selftests.awk13
-rwxr-xr-xcommon/scripts/dt-selftests.sh12
2 files changed, 25 insertions, 0 deletions
diff --git a/common/scripts/dt-selftests.awk b/common/scripts/dt-selftests.awk
new file mode 100755
index 0000000..a33eaf2
--- /dev/null
+++ b/common/scripts/dt-selftests.awk
@@ -0,0 +1,13 @@
+#!/usr/bin/awk
+started && /### dt-test ### end of selftest/ {
+ sub(/,/, "", $11)
+ printf "DT-SELFTEST %s: %s\n", $11, $10
+ printf "DT-SELFTEST %s: %s\n", $13, $12
+ print "dt-selftest end"
+ exit
+}
+
+!started && /### dt-test ### start of selftest/ {
+ print "dt-selftest start"
+ started = 1
+}
diff --git a/common/scripts/dt-selftests.sh b/common/scripts/dt-selftests.sh
new file mode 100755
index 0000000..1c77099
--- /dev/null
+++ b/common/scripts/dt-selftests.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+cd common/scripts
+dmesg | awk -f dt-selftests.awk > dt-selftest-stdout.log
+NO_OF_PASS=`grep "DT-SELFTEST passed" dt-selftest-stdout.log | awk '{print $3}'`
+NO_OF_FAIL=`grep "DT-SELFTEST failed" dt-selftest-stdout.log | awk '{print $3}'`
+if [ $NO_OF_FAIL -ne 0 ] ; then
+ echo "test_case_id:dt-selftest-passed measurement:$NO_OF_PASS result:passed"
+ echo "test_case_id:dt-selftest-failed measurement:$NO_OF_FAIL result:failed"
+else
+ echo "test_case_id:dt-selftest-passed measurement:$NO_OF_PASS result:passed"
+ echo "test_case_id:dt-selftest-failed measurement:$NO_OF_FAIL result:passed"
+fi