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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
#!@BASHREAL@
# Meta-harness for rastertogutenprint test harness.
#
## Copyright (C) 2018 Robert Krawitz
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
if [[ -n "$STP_TEST_LOG_PREFIX" ]] ; then
redir="${STP_TEST_LOG_PREFIX}${0##*/}_$$.log"
if [[ -n $BUILD_VERBOSE ]] ; then
exec > >(tee -a "$redir" >&3)
else
exec 1>>"$redir"
fi
exec 2>&1
fi
STP_TEST_PROFILE=${STP_TEST_PROFILE:-full}
set -e
declare QUIET=${TRAVIS_MODE:+-q}
declare FASTOPT="-dDitherAlgorithm=VeryFast -dResolution=MIN -dPageSize=MIN"
declare MIN_PRINTERS="@MINIMAL_PRINTERS_TO_TEST@"
function runit() {
echo "================================================================"
echo "$@"
[[ -z $STP_TEST_DEBUG ]] && "$@"
}
function test_minimal() {
runit ./run-testpattern-2 -s $FASTOPT -dColorCorrection=Raw \
-o InkType -o InkSet,RawChannels -o Duplex \
-o MediaType -o InputSlot -o FullBleed -o UseGloss \
-o Orientation -o LabelSeparator -o Resolution -T 720 \
"$@" $MIN_PRINTERS
runit ./run-testpattern-2 -s $FASTOPT -dColorCorrection=Raw -o - -G 1x1
}
function test_fast() {
runit ./run-testpattern-2 -s $QUIET $FASTOPT -dColorCorrection=Raw \
-o InkType -o InkSet,RawChannels -o Duplex \
-o MediaType -o InputSlot -o FullBleed -o UseGloss \
-o Orientation -o LabelSeparator -o Resolution -T 720 "$@"
runit ./run-testpattern-2 $QUIET $FASTOPT -dColorCorrection=Raw -o -
runit ./run-testpattern-2 -s $FASTOPT \
-o TPMode,ColorCorrection,InkType,UseGloss $MIN_PRINTERS
runit ./run-testpattern-2 -s $QUIET $FASTOPT -o - -G 1x1
}
function test_full() {
runit ./run-testpattern-2 -s $QUIET
runit ./run-testpattern-2 $QUIET $FASTOPT -dColorCorrection=Raw -o - -G 1x1
runit ./run-testpattern-2 -s $QUIET \
-oPageSize,Resolution=MIN,DitherAlgorithm=VeryFast
runit ./run-testpattern-2 -s $QUIET $FASTOPT \
-o TPMode,ColorCorrection,InkType,UseGloss
}
function test_valgrind_minimal() {
runit ./run-testpattern-2 -s -v -v $FASTOPT -o InkType \
-o InkSet,RawChannels -o Duplex -o MediaType -o InputSlot \
-o FullBleed -o UseGloss -o Orientation -o LabelSeparator "$@" \
$MIN_PRINTERS
runit ./run-testpattern-2 -s -v -v $FASTOPT -o - -G 1x1 "$@" \
$MIN_PRINTERS
}
function test_valgrind_fast() {
test_valgrind_minimal
runit ./run-testpattern-2 -s -v -v $QUIET $FASTOPT -o - "$@"
}
function test_valgrind() {
runit ./run-testpattern-2 -s -v -v $QUIET $FASTOPT -o InkType \
-o InkSet,RawChannels -o Duplex -o MediaType -o InputSlot \
-o FullBleed -o UseGloss -o Orientation -o LabelSeparator "$@"
runit ./run-testpattern-2 -s -v -v $FASTOPT \
-o TPMode,ColorCorrection,InkType,UseGloss "$@" $MIN_PRINTERS
runit ./run-testpattern-2 -s -v -v $QUIET $FASTOPT -dColorCorrection=Raw -o - -G 1x1
}
function test_checksums() {
export STP_DEBUG=$(printf "0x%x" $((0x8000000 | ${STP_DEBUG:-0})))
runit ./run-testpattern-2 -q -M ':4' "$@"
runit ./run-testpattern-2 -F -s -q -M ':4' \
-o PageSize,Resolution=MIN,DitherAlgorithm=VeryFast "$@"
runit ./run-testpattern-2 -F -s -q -M ':4' $FASTOPT \
-o TPMode,ColorCorrection,InkType,UseGloss "$@"
}
case "$STP_TEST_PROFILE" in
full|fast|valgrind|checksums|minimal|valgrind_minimal|valgrind_fast)
test_$STP_TEST_PROFILE
;;
*)
exit 77
;;
esac
|