libdisplay-info/test/edid-decode-check.sh
Simon Ser 4e5df43659 test: rename EDID files with .edid filename extension
This makes it easier to perform an operation on all EDID files at
once, e.g. "test/edid-decode-diff.sh test/data/*.edid" to update all
diffs at once.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-29 15:23:41 +02:00

18 lines
375 B
Bash
Executable file

#!/bin/sh -eu
workdir="$(mktemp -d)"
cleanup() {
rm -rf "$workdir"
}
trap cleanup EXIT
edid="$1"
diff="${edid%.edid}.diff"
"$REF_EDID_DECODE" --skip-hex-dump --check --skip-sha <"$edid" >"$workdir/ref" || [ $? = 254 ]
"$DI_EDID_DECODE" <"$edid" >"$workdir/di" || [ $? = 254 ]
if [ -f "$diff" ]; then
patch "$workdir/ref" "$diff"
fi
diff -u "$workdir/ref" "$workdir/di"