libdisplay-info/test/edid-decode-check.sh
Sebastian Wick eed3e1e0f8 test: remove edid-decode as a test dependency
by storing the reference edid-decode output in the repository. It is now
only a dependency for the gen-test-data target. The CI checks that the
reference output in the repository matches the one generated from a
specific checkout of edid-decode.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-02-23 20:50:13 +01:00

20 lines
330 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%.edid}.ref"
cp "$ref" "$workdir/ref"
"$DI_EDID_DECODE" <"$edid" >"$workdir/di" || [ $? = 254 ]
if [ -f "$diff" ]; then
patch "$workdir/ref" "$diff"
fi
diff -u "$workdir/ref" "$workdir/di"