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>
This commit is contained in:
Simon Ser 2022-08-29 14:16:36 +02:00
parent 37a6186445
commit 4e5df43659
8 changed files with 7 additions and 5 deletions

View file

@ -7,11 +7,12 @@ cleanup() {
trap cleanup EXIT trap cleanup EXIT
edid="$1" edid="$1"
diff="${edid%.edid}.diff"
"$REF_EDID_DECODE" --skip-hex-dump --check --skip-sha <"$edid" >"$workdir/ref" || [ $? = 254 ] "$REF_EDID_DECODE" --skip-hex-dump --check --skip-sha <"$edid" >"$workdir/ref" || [ $? = 254 ]
"$DI_EDID_DECODE" <"$edid" >"$workdir/di" || [ $? = 254 ] "$DI_EDID_DECODE" <"$edid" >"$workdir/di" || [ $? = 254 ]
if [ -f "$edid.diff" ]; then if [ -f "$diff" ]; then
patch "$workdir/ref" "$edid.diff" patch "$workdir/ref" "$diff"
fi fi
diff -u "$workdir/ref" "$workdir/di" diff -u "$workdir/ref" "$workdir/di"

View file

@ -10,11 +10,12 @@ cleanup() {
trap cleanup EXIT trap cleanup EXIT
for edid in "$@"; do for edid in "$@"; do
diff="${edid%.edid}.diff"
"$REF_EDID_DECODE" --skip-hex-dump --check --skip-sha <"$edid" >"$workdir/ref" || [ $? = 254 ] "$REF_EDID_DECODE" --skip-hex-dump --check --skip-sha <"$edid" >"$workdir/ref" || [ $? = 254 ]
"$DI_EDID_DECODE" <"$edid" >"$workdir/di" || [ $? = 254 ] "$DI_EDID_DECODE" <"$edid" >"$workdir/di" || [ $? = 254 ]
if ! diff -u --label ref "$workdir/ref" --label di "$workdir/di" >"$workdir/diff"; then if ! diff -u --label ref "$workdir/ref" --label di "$workdir/di" >"$workdir/diff"; then
cp "$workdir/diff" "$edid.diff" cp "$workdir/diff" "$diff"
else else
rm -f "$edid.diff" rm -f "$diff"
fi fi
done done

View file

@ -18,7 +18,7 @@ foreach tc : test_cases
test( test(
tc, tc,
test_harness, test_harness,
args: [files('data/' + tc)], args: [files('data/' + tc + '.edid')],
env: [ env: [
'REF_EDID_DECODE=' + ref_edid_decode.full_path(), 'REF_EDID_DECODE=' + ref_edid_decode.full_path(),
'DI_EDID_DECODE=' + di_edid_decode.full_path(), 'DI_EDID_DECODE=' + di_edid_decode.full_path(),