Commit 783280d0 authored by Petri Latvala's avatar Petri Latvala

scripts/verify-blacklist: Script for checking blacklist files

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.

v2: Use long options for readability, exit with 1 if something found

v3: Verify manually against the list of all tests instead of trying
    with igt_runner's --include-tests
Signed-off-by: Petri Latvala's avatarPetri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent 90611a0c
#!/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 2
}
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
STATUS=0
TESTLIST="$("$RUNNER" --list-all "$BINDIR")"
cat "$BLFILE" | while read line; do
blentry=$(echo "$line" | sed 's/#.*//' | tr -d '[:space:]')
if [ "$blentry" = "" ]; then continue; fi
if ! (echo "$TESTLIST" | grep -Pq "$blentry") >/dev/null 2>/dev/null; then
echo Useless blacklist entry: "$blentry"
STATUS=1
fi
done
exit $STATUS
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment