summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2016-10-06 13:11:16 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2016-10-07 13:02:37 +0300
commit8c545a3668aaa155b106531a7274a33fa40daee7 (patch)
treed34e7197c710a3a6de88206f10bc6a991c12d95e /tests
parent51b759002436ff3148ab1fc56999760919bfc008 (diff)
tests: Leave basic breadcrumbs in dmesg for shell script based tests
Leave the normal "executing" and "exiting" breadcrumbs into dmesg when running the test. v2: s/$1/$@/ (Jani) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/drm_lib.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
index 0eeab1c1..113da4c7 100755
--- a/tests/drm_lib.sh
+++ b/tests/drm_lib.sh
@@ -3,6 +3,30 @@
SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
. $SOURCE_DIR/drm_getopt.sh
+NAME=$(basename "$0")
+
+KERN_EMER="<0>"
+KERN_ALERT="<1>"
+KERN_CRIT="<2>"
+KERN_ERR="<3>"
+KERN_WARNING="<4>"
+KERN_NOTICE="<5>"
+KERN_INFO="<6>"
+KERN_DEBUG="<7>"
+
+kmsg() {
+ echo "$@" > /dev/kmsg
+}
+
+finish() {
+ exitcode=$?
+ kmsg "$KERN_INFO$NAME: exiting, ret=$exitcode"
+ exit $exitcode
+}
+trap finish EXIT
+
+kmsg "$KERN_INFO$NAME: executing"
+
skip() {
echo "$@"
exit $IGT_EXIT_SKIP