2022-03-28 11:17:07 +02:00
|
|
|
#!/bin/sh -eu
|
|
|
|
|
|
|
|
REF_EDID_DECODE="${REF_EDID_DECODE:-edid-decode}"
|
2022-10-14 12:49:41 +02:00
|
|
|
|
|
|
|
BUILDDIR="${BUILDDIR:-./build}"
|
2022-11-23 11:11:16 +01:00
|
|
|
DI_EDID_DECODE="${DI_EDID_DECODE:-${BUILDDIR}/di-edid-decode/di-edid-decode}"
|
2022-10-14 12:49:41 +02:00
|
|
|
DI_EDID_PRINT="${DI_EDID_PRINT:-${BUILDDIR}/test/di-edid-print}"
|
2022-03-28 11:17:07 +02:00
|
|
|
|
|
|
|
workdir="$(mktemp -d)"
|
|
|
|
cleanup() {
|
|
|
|
rm -rf "$workdir"
|
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
|
|
|
for edid in "$@"; do
|
2022-08-29 14:16:36 +02:00
|
|
|
diff="${edid%.edid}.diff"
|
2022-08-02 11:12:42 +02:00
|
|
|
"$REF_EDID_DECODE" --skip-hex-dump --check --skip-sha <"$edid" >"$workdir/ref" || [ $? = 254 ]
|
2022-08-02 11:42:27 +02:00
|
|
|
"$DI_EDID_DECODE" <"$edid" >"$workdir/di" || [ $? = 254 ]
|
2023-02-14 21:58:44 +01:00
|
|
|
cp "$workdir/ref" "${edid%.edid}.ref"
|
2022-03-28 11:17:07 +02:00
|
|
|
if ! diff -u --label ref "$workdir/ref" --label di "$workdir/di" >"$workdir/diff"; then
|
2022-08-29 14:16:36 +02:00
|
|
|
cp "$workdir/diff" "$diff"
|
2022-03-28 11:17:07 +02:00
|
|
|
else
|
2022-08-29 14:16:36 +02:00
|
|
|
rm -f "$diff"
|
2022-03-28 11:17:07 +02:00
|
|
|
fi
|
2022-10-14 10:03:35 +02:00
|
|
|
|
|
|
|
"$DI_EDID_PRINT" <"$edid" >"${edid%.edid}.print"
|
2022-03-28 11:17:07 +02:00
|
|
|
done
|