summaryrefslogtreecommitdiff
path: root/src/cups/test-rastertogutenprint.check.in
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2018-09-28 10:34:15 +0200
committerDidier Raboud <odyx@debian.org>2018-09-28 10:34:15 +0200
commit477a402e36e91cb68b09f70ddf32a8ea1e47c22f (patch)
tree655c3f6331a6e8fd8b09ceb4da8f5896484ae16a /src/cups/test-rastertogutenprint.check.in
Import gutenprint_5.3.1.orig.tar.xz
[dgit import orig gutenprint_5.3.1.orig.tar.xz]
Diffstat (limited to 'src/cups/test-rastertogutenprint.check.in')
-rw-r--r--src/cups/test-rastertogutenprint.check.in77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/cups/test-rastertogutenprint.check.in b/src/cups/test-rastertogutenprint.check.in
new file mode 100644
index 0000000..cd3f38b
--- /dev/null
+++ b/src/cups/test-rastertogutenprint.check.in
@@ -0,0 +1,77 @@
+#!@BASHREAL@
+
+# Harness for rastertogutenprint tester.
+#
+# Copyright 2007-2017 Robert Krawitz (rlk@alum.mit.edu)
+#
+# 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 of the License, 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 FASTOPT="-o StpDitherAlgorithm=VeryFast -l -N -o ColorCorrection=Raw"
+declare MIN_PRINTERS="@MINIMAL_PRINTERS_TO_TEST@"
+
+function runit() {
+ echo "================================================================"
+ echo "$@"
+ [[ -z $STP_TEST_DEBUG ]] && "$@"
+}
+
+function test_minimal() {
+ runit ./test-rastertogutenprint -s $FASTOPT -p 1 \
+ $MIN_PRINTERS
+}
+
+function test_fast() {
+ runit ./test-rastertogutenprint -S -s $FASTOPT -p 2
+}
+
+function test_full() {
+ runit ./test-rastertogutenprint -l -p 2 $FASTOPT
+ runit ./test-rastertogutenprint -S -s -X
+}
+
+function test_valgrind_minimal() {
+ runit ./test-rastertogutenprint -v -v -s $FASTOPT -p 1 \
+ $MIN_PRINTERS
+}
+
+function test_valgrind_fast() {
+ test_valgrind_minimal
+}
+
+function test_valgrind() {
+ runit ./test-rastertogutenprint -v -v -S -s $FASTOPT -p 2
+}
+
+case "$STP_TEST_PROFILE" in
+ full|fast|valgrind|valgrind_minimal|valgrind_fast|minimal)
+ test_$STP_TEST_PROFILE
+ ;;
+ *)
+ exit 77
+ ;;
+esac