summaryrefslogtreecommitdiff
path: root/src/cups/test-ppds
blob: a5fa5a7b1961e07fda90921dd13f2049b4bac5e0 (plain)
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

if [ "$#" = 0 ] ; then
    echo "Bypassing test-ppds for now due to bugs in cupstestppd!"
    exit 0
    rm -rf ppd ppd-stamp
    make ppd
fi

ppd_count=`find ppd \( -name '*.ppd.gz' -o -name '*.ppd' \) -print | wc -l`

failures="`find ppd -name '*.ppd*' -print | xargs cupstestppd |grep 'FAIL$' | awk -F: '{print $1}'`"

if [ -z "$failures" ] ; then
    echo "All $ppd_count PPD files pass"
    exit 0
fi

# Use this with "normal" PPD files without translated numbers.
echo $failures | xargs cupstestppd 2>&1 | egrep -v 'Missing "[a-z][a-z](_[A-Z][A-Z])?" translation string for option Stp((Brightness|Contrast|Saturation), choice None|([a-zA-Z0-9]+, choice (-?[0-9]+)))!$' |egrep -v 'Missing cupsICCProfile file'

# Use this with PPD files with translated numbers (genppd -N)
# With normal globalized PPD files this will yield hundreds of megabytes
# of errors.
#echo $failures | xargs cupstestppd 2>&1 |egrep -v 'Missing cupsICCProfile file'

fail_count=`echo "$failures" | wc -l`
echo "$fail_count/$ppd_count fail"
exit 1