mirror of
https://gitlab.freedesktop.org/emersion/libdisplay-info.git
synced 2024-12-25 21:59:08 +01:00
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:
parent
37a6186445
commit
4e5df43659
8 changed files with 7 additions and 5 deletions
|
@ -7,11 +7,12 @@ cleanup() {
|
|||
trap cleanup EXIT
|
||||
|
||||
edid="$1"
|
||||
diff="${edid%.edid}.diff"
|
||||
"$REF_EDID_DECODE" --skip-hex-dump --check --skip-sha <"$edid" >"$workdir/ref" || [ $? = 254 ]
|
||||
"$DI_EDID_DECODE" <"$edid" >"$workdir/di" || [ $? = 254 ]
|
||||
|
||||
if [ -f "$edid.diff" ]; then
|
||||
patch "$workdir/ref" "$edid.diff"
|
||||
if [ -f "$diff" ]; then
|
||||
patch "$workdir/ref" "$diff"
|
||||
fi
|
||||
|
||||
diff -u "$workdir/ref" "$workdir/di"
|
||||
|
|
|
@ -10,11 +10,12 @@ cleanup() {
|
|||
trap cleanup EXIT
|
||||
|
||||
for edid in "$@"; do
|
||||
diff="${edid%.edid}.diff"
|
||||
"$REF_EDID_DECODE" --skip-hex-dump --check --skip-sha <"$edid" >"$workdir/ref" || [ $? = 254 ]
|
||||
"$DI_EDID_DECODE" <"$edid" >"$workdir/di" || [ $? = 254 ]
|
||||
if ! diff -u --label ref "$workdir/ref" --label di "$workdir/di" >"$workdir/diff"; then
|
||||
cp "$workdir/diff" "$edid.diff"
|
||||
cp "$workdir/diff" "$diff"
|
||||
else
|
||||
rm -f "$edid.diff"
|
||||
rm -f "$diff"
|
||||
fi
|
||||
done
|
||||
|
|
|
@ -18,7 +18,7 @@ foreach tc : test_cases
|
|||
test(
|
||||
tc,
|
||||
test_harness,
|
||||
args: [files('data/' + tc)],
|
||||
args: [files('data/' + tc + '.edid')],
|
||||
env: [
|
||||
'REF_EDID_DECODE=' + ref_edid_decode.full_path(),
|
||||
'DI_EDID_DECODE=' + di_edid_decode.full_path(),
|
||||
|
|
Loading…
Reference in a new issue