[RT-HINTS][PATCH 2/2] run-test: add basic testing script
Krzysztof Kozlowski
krzysztof.kozlowski at canonical.com
Tue Jun 29 13:20:43 UTC 2021
People are lazy and don't read readme's, so give them easier way to test
the hinting. Additionally this uses proper output directory so the
compile-hints won't return 255 error code.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski at canonical.com>
---
run-test.sh | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100755 run-test.sh
diff --git a/run-test.sh b/run-test.sh
new file mode 100755
index 000000000000..aea7776de47e
--- /dev/null
+++ b/run-test.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2021, Canonical Ltd.
+
+TMPDIR=""
+
+cleanup() {
+ test "$TMPDIR" != "" || return 0
+ test -d "$TMPDIR" || return 0
+
+ rm -fr "$TMPDIR"
+}
+trap cleanup EXIT
+
+TMPDIR=$(mktemp -d)
+ret=$?
+test $ret -eq 0 || { echo "FAIL" ; exit $ret ; }
+
+./compile-hints . $TMPDIR
+ret=$?
+test $ret -eq 0 || { echo "FAIL" ; exit $ret ; }
+
+exit $ret
--
2.27.0
More information about the kernel-team
mailing list