mirror of
https://gitlab.freedesktop.org/emersion/libdisplay-info.git
synced 2024-12-25 21:59:08 +01:00
a8e78208a5
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
20 lines
460 B
Bash
Executable file
20 lines
460 B
Bash
Executable file
#!/bin/sh -eu
|
|
|
|
REF_EDID_DECODE="${REF_EDID_DECODE:-edid-decode}"
|
|
DI_EDID_DECODE="${DI_EDID_DECODE:-di-edid-decode}"
|
|
|
|
workdir="$(mktemp -d)"
|
|
cleanup() {
|
|
rm -rf "$workdir"
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
for edid in "$@"; do
|
|
"$REF_EDID_DECODE" -s <"$edid" >"$workdir/ref"
|
|
"$DI_EDID_DECODE" <"$edid" >"$workdir/di"
|
|
if ! diff -u --label ref "$workdir/ref" --label di "$workdir/di" >"$workdir/diff"; then
|
|
cp "$workdir/diff" "$edid.diff"
|
|
else
|
|
rm "$edid.diff"
|
|
fi
|
|
done
|