From: Michael R Sweet Date: Sat, 14 Nov 2020 14:09:48 +0000 (-0500) Subject: Make some changes to allow the automated test suite to run in certain restricted X-Git-Tag: v2.3.3op1~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89c179c8ab4ccc90e3482b0aa89657343967d2b0;p=thirdparty%2Fcups.git Make some changes to allow the automated test suite to run in certain restricted build/CI setups (Issue #25) --- diff --git a/CHANGES-OPENPRINTING.md b/CHANGES-OPENPRINTING.md index 9876ea6536..a8743728ec 100644 --- a/CHANGES-OPENPRINTING.md +++ b/CHANGES-OPENPRINTING.md @@ -45,6 +45,8 @@ Changes in CUPS v2.3.3op1 - Fixed output-bin and print-quality handling issues (Issue #18) - Fixed PPD options getting mapped to odd IPP values like "tray---4" (Issue #23) - Fixed remote access to the cupsd.conf and log files (Issue #24) +- Fixed the automated test suite when running in certain build/CI environments + (Issue #25) - Fixed a logging regression caused by a previous change for Apple issue #5604 (Issue #25) - Fixed fax phone number handling with GNOME (Issue #40) diff --git a/cups/testi18n.c b/cups/testi18n.c index 45e1cab35d..4a67c93ba2 100644 --- a/cups/testi18n.c +++ b/cups/testi18n.c @@ -410,7 +410,7 @@ main(int argc, /* I - Argument Count */ puts("PASS"); } -#ifndef __linux +#if !defined(__linux__) && !defined(__GLIBC__) fputs("cupsCharsetToUTF8(CUPS_EUC_JP): ", stdout); strlcpy(legsrc, legdest, sizeof(legsrc)); @@ -432,7 +432,7 @@ main(int argc, /* I - Argument Count */ } else puts("PASS"); -#endif /* !__linux */ +#endif /* !__linux && !__GLIBC__ */ /* * Test UTF-8 to/from legacy charset (Windows 950)... diff --git a/cups/testppd.c b/cups/testppd.c index 36707f29a6..c295d478bf 100644 --- a/cups/testppd.c +++ b/cups/testppd.c @@ -658,6 +658,12 @@ main(int argc, /* I - Number of command-line arguments */ * Test localization... */ + /* Force US English base locale */ + putenv("LANG=en"); + putenv("LC_ALL=en"); + putenv("LC_CTYPE=en"); + putenv("LC_MESSAGES=en"); + fputs("ppdLocalizeIPPReason(text): ", stdout); if (ppdLocalizeIPPReason(ppd, "foo", NULL, buffer, sizeof(buffer)) && !strcmp(buffer, "Foo Reason")) @@ -698,6 +704,7 @@ main(int argc, /* I - Number of command-line arguments */ printf("FAIL (\"%s\" instead of \"/help/foo/bar.html\")\n", buffer); } + /* Force French */ putenv("LANG=fr"); putenv("LC_ALL=fr"); putenv("LC_CTYPE=fr"); @@ -713,6 +720,7 @@ main(int argc, /* I - Number of command-line arguments */ printf("FAIL (\"%s\" instead of \"La Long Foo Reason\")\n", buffer); } + /* Force Simplified Chinese */ putenv("LANG=zh_TW"); putenv("LC_ALL=zh_TW"); putenv("LC_CTYPE=zh_TW"); @@ -732,6 +740,7 @@ main(int argc, /* I - Number of command-line arguments */ * cupsMarkerName localization... */ + /* Force US English base locale */ putenv("LANG=en"); putenv("LC_ALL=en"); putenv("LC_CTYPE=en"); @@ -759,6 +768,7 @@ main(int argc, /* I - Number of command-line arguments */ text ? text : "(null)"); } + /* Force French locale */ putenv("LANG=fr"); putenv("LC_ALL=fr"); putenv("LC_CTYPE=fr"); @@ -775,6 +785,7 @@ main(int argc, /* I - Number of command-line arguments */ text ? text : "(null)"); } + /* Force Simplified Chinese locale */ putenv("LANG=zh_TW"); putenv("LC_ALL=zh_TW"); putenv("LC_CTYPE=zh_TW"); @@ -793,6 +804,12 @@ main(int argc, /* I - Number of command-line arguments */ ppdClose(ppd); + /* Force US English base locale */ + putenv("LANG=en"); + putenv("LC_ALL=en"); + putenv("LC_CTYPE=en"); + putenv("LC_MESSAGES=en"); + /* * Test new constraints... */ diff --git a/test/run-stp-tests.sh b/test/run-stp-tests.sh index 2f9630f524..1af6d07417 100755 --- a/test/run-stp-tests.sh +++ b/test/run-stp-tests.sh @@ -268,7 +268,7 @@ case "$usedebugprintfs" in echo "Enabling debug printfs (level $usedebugprintfs); log files can be found in $BASE/log..." CUPS_DEBUG_LOG="$BASE/log/debug_printfs.%d"; export CUPS_DEBUG_LOG CUPS_DEBUG_LEVEL="$usedebugprintfs"; export CUPS_DEBUG_LEVEL - CUPS_DEBUG_FILTER='^(http|_http|ipp|_ipp|cups.*Request|cupsGetResponse|cupsSend|mime).*$'; export CUPS_DEBUG_FILTER + CUPS_DEBUG_FILTER='^(http|_http|ipp|_ipp|cups.*Request|cupsGetResponse|cupsSend).*$'; export CUPS_DEBUG_FILTER ;; *) @@ -443,14 +443,12 @@ EOF } ln -s $root/test/test.convs $BASE/share/mime -ln -s $root/test/test.types $BASE/share/mime if test `uname` = Darwin; then instfilter cgimagetopdf imagetopdf pdf instfilter cgpdftopdf pdftopdf passthru instfilter cgpdftops pdftops ps instfilter cgpdftoraster pdftoraster raster - instfilter cgpdftoraster pdftourf raster instfilter cgtexttopdf texttopdf pdf instfilter pstocupsraster pstoraster raster else @@ -458,7 +456,6 @@ else instfilter pdftopdf pdftopdf passthru instfilter pdftops pdftops ps instfilter pdftoraster pdftoraster raster - instfilter pdftoraster pdftourf raster instfilter pstoraster pstoraster raster instfilter texttopdf texttopdf pdf @@ -776,6 +773,13 @@ echo " $date by $user on `hostname`." >>$strfile echo "
" >>$strfile
 
 for file in 5*.sh; do
+	# Wait for jobs from the previous test to complete before running the
+	# next test...
+	if test $file != 5.1-lpadmin.sh; then
+		./waitjobs.sh 1800
+	fi
+
+	# Run the test...
 	echo $ac_n "Performing $file: $ac_c"
 	echo "" >>$strfile
         echo "`date '+[%d/%b/%Y:%H:%M:%S %z]'` \"$file\":" >>$strfile
@@ -1040,7 +1044,7 @@ else
 fi
 
 # Warning log messages
-count=`$GREP '^W ' $BASE/log/error_log | $GREP -v CreateProfile | wc -l | awk '{print $1}'`
+count=`$GREP '^W ' $BASE/log/error_log | $GREP -v CreateProfile | $GREP -v 'libusb error' | $GREP -v ColorManager | $GREP -v 'Avahi client failed' | wc -l | awk '{print $1}'`
 if test $count != 8; then
 	echo "FAIL: $count warning messages, expected 8."
 	$GREP '^W ' $BASE/log/error_log
diff --git a/test/test.convs b/test/test.convs
index 77a9ce01ed..57540aac43 100644
--- a/test/test.convs
+++ b/test/test.convs
@@ -2,7 +2,6 @@
 application/pdf application/vnd.cups-pdf 100 pdftopdf
 application/pdf application/postscript 100 pdftops
 application/pdf application/vnd.cups-raster 100 pdftoraster
-application/pdf image/urf 100 pdftourf
 application/postscript application/vnd.cups-raster 100 pstoraster
 image/jpeg application/pdf 100 imagetopdf
 text/plain application/pdf 100 texttopdf