diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2013-07-11 09:59:46 -0700 |
---|---|---|
committer | Ben Widawsky <ben@bwidawsk.net> | 2013-07-21 22:04:20 -0700 |
commit | 89d96a12d61cade801f07e0d78028a613b841978 (patch) | |
tree | e2672afa0a7fe06d12a7afe2ea42ec98d2a4e311 | |
parent | f801b928826f3a23979bf6e2747611895b1ea9c2 (diff) |
tests: Basic tools tester
Requested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rwxr-xr-x | tests/drm_lib.sh | 4 | ||||
-rwxr-xr-x | tests/tools_test | 18 |
3 files changed, 23 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 4460675d..c692b0c5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -115,6 +115,7 @@ TESTS_scripts_M = \ TESTS_scripts = \ test_rte_check \ + tools_test \ debugfs_reader \ debugfs_emon_crash \ sysfs_l3_parity \ diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh index 25197d40..97f6f925 100755 --- a/tests/drm_lib.sh +++ b/tests/drm_lib.sh @@ -4,6 +4,10 @@ die() { exit 1 } +do_or_die() { + $@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit -1) +} + if [ -d /debug/dri ] ; then debugfs_path=/debug/dri fi diff --git a/tests/tools_test b/tests/tools_test new file mode 100755 index 00000000..4c5577a7 --- /dev/null +++ b/tests/tools_test @@ -0,0 +1,18 @@ +#!/bin/bash +# Test some of the most critical tools we have accidentally broken before. +# TODO: Possibly make tests parse output + +whoami | grep -q root || ( echo ERROR: not running as root; exit 1 ) + +SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" +. $SOURCE_DIR/drm_lib.sh + +# ARB_MODE has existed for many gens +do_or_die "$SOURCE_DIR/../tools/intel_reg_read 0x4030" + +do_or_die "$SOURCE_DIR/../tools/intel_reg_dumper" + +# TODO: Add more tests + +exit 0 + |