File: upstream-utils-samples

package info (click to toggle)
lcms2 2.17-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,632 kB
  • sloc: ansic: 46,202; sh: 4,263; pascal: 1,960; makefile: 197; cpp: 84
file content (32 lines) | stat: -rwxr-xr-x 951 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
30
31
32
#!/bin/bash

set -e

if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
    CROSS_COMPILE=${DEB_HOST_GNU_TYPE}-
else
    CROSS_COMPILE=
fi

SRC="$(pwd)"
cd "$AUTOPKGTEST_TMP"

# check whether some upstream samples can still be compiled against the packages *as-installed*
# and check whether they still succeed
# [<sourcefile>]=<params>
declare -A TESTS=(
    [utils/samples/roundtrip.c]='testbed/ibm-t61.icc testbed/new.icc testbed/test3.icc testbed/test4.icc' # i.e. the relevant RGB profiles
    [utils/samples/mktiff8.c]='dummyparameter' # does not actually take a parameter
)
PKGCONFIG="$(pkg-config --cflags --libs lcms2)"
for KEY in "${!TESTS[@]}"; do
    FILENAME="$SRC/$KEY"
    ITEM="$(basename "$FILENAME" .c)"
    echo "COMPILING $ITEM"
    ${CROSS_COMPILE}gcc -pedantic -Wall -Werror -o "$ITEM" "$FILENAME" $PKGCONFIG
    for PARAM in ${TESTS[$KEY]}; do
        echo "EXECUTING $ITEM $SRC/$PARAM"
        ./$ITEM $SRC/$PARAM
    done
    echo
done