File: parse-regression.sh

package info (click to toggle)
libexif 0.6.25-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,640 kB
  • sloc: ansic: 13,211; cpp: 457; makefile: 395; sh: 206
file content (29 lines) | stat: -rwxr-xr-x 798 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
# Parses test EXIF files and compares the results to that expected
#
# Copyright (C) 2018-2021 Dan Fandrich <dan@coneharvesters.com>, et. al.
# SPDX-License-Identifier: LGPL-2.0-or-later

srcdir="${srcdir:-.}"
TMPLOG="$(mktemp)"
trap 'rm -f "${TMPLOG}"' 0

. ${srcdir}/inc-comparetool.sh

# Ensure that names are untranslated
LANG=
LANGUAGE=
LC_ALL=C
export LANG LANGUAGE LC_ALL
for fn in "${srcdir}"/testdata/*.jpg ; do
    # The *.parsed text files have LF line endings, so the tr removes
    # the CR from CRLF line endings, while keeping LF line endings the
    # same.
    ./test-parse$EXEEXT "${fn}" | tr -d '\015' > "${TMPLOG}"
    if ${comparetool} "${fn}.parsed" "${TMPLOG}"; then
	: "no differences detected"
    else
        echo "Error parsing $fn"
        exit 1
    fi
done