libdisplay-info/test/edid-decode-check.sh
Simon Ser a8e78208a5 Add edid-decode testing infrastructure
Add two small shell utilities to generate and compare diffs between
edid-decode and di-edid-decode. Store the diffs in-tree and add tests
to ensure they don't regress. Run the tests in CI with a pinned
installation of edid-decode.

One EDID blob is added to the test collection: dell-2408wfp-dp. It's
extracted [1] from the edid-decode repository.

[1]: https://git.linuxtv.org/edid-decode.git/tree/data/dell-2408wfp-dp

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/issues/5
2022-05-12 11:35:58 +02:00

17 lines
295 B
Bash
Executable file

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