From: Petri Latvala <petri.latvala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t] scripts/verify-blacklist: Script for checking blacklist files
Date: Wed, 4 Mar 2020 14:10:44 +0200 [thread overview]
Message-ID: <20200304121044.26908-1-petri.latvala@intel.com> (raw)
tests/intel-ci/blacklist*.txt files can collect bitrot unless there's
an easy way to check for lines that are no longer needed due to the
tests being renamed or removed. Therefore, a script just for that.
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
scripts/verify-blacklist.sh | 47 +++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
create mode 100755 scripts/verify-blacklist.sh
diff --git a/scripts/verify-blacklist.sh b/scripts/verify-blacklist.sh
new file mode 100755
index 00000000..a88b32be
--- /dev/null
+++ b/scripts/verify-blacklist.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# Verify that all entries in a blacklist file are still valid
+
+usage() {
+ echo "Usage: $0 <path-to-igt-runner> <test-binary-directory> <blacklist-file>"
+ echo
+ echo " path-to-igt-runner: For example build/runner/igt_runner"
+ echo " test-binary-directory: For example build/tests"
+ echo " blacklist-file: For example tests/intel-ci/blacklist.txt"
+ exit 1
+}
+
+if [ $# -ne 3 ]; then
+ usage
+fi
+
+RUNNER="$1"
+BINDIR="$2"
+BLFILE="$3"
+
+if [ ! -x "$RUNNER" ]; then
+ echo "$RUNNER not found"
+ echo
+ usage
+fi
+
+if [ ! -f "$BINDIR/test-list.txt" ]; then
+ echo "$BINDIR doesn't look like a test-binary directory"
+ echo
+ usage
+fi
+
+if [ ! -f "$BLFILE" ]; then
+ echo "$BLFILE not found"
+ echo
+ usage
+fi
+
+cat "$BLFILE" | while read line; do
+ test=$(echo "$line" | sed 's/#.*//' | tr -d '[:space:]')
+ if [ "$test" = "" ]; then continue; fi
+
+ if ! "$RUNNER" -L -t "$test" "$BINDIR" >/dev/null 2>/dev/null; then
+ echo Useless blacklist entry: "$test"
+ fi
+done
--
2.20.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next reply other threads:[~2020-03-04 12:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-04 12:10 Petri Latvala [this message]
2020-03-04 13:28 ` [igt-dev] ✓ Fi.CI.BAT: success for scripts/verify-blacklist: Script for checking blacklist files Patchwork
2020-03-05 7:01 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2020-03-05 13:30 ` [igt-dev] [PATCH i-g-t] " Arkadiusz Hiler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200304121044.26908-1-petri.latvala@intel.com \
--to=petri.latvala@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox