• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 72fa126446460347a504f3d9b90f24aed1365595 Mon Sep 17 00:00:00 2001
2From: Cosmin Truta <ctruta@gmail.com>
3Date: Sun, 21 Apr 2019 00:30:14 -0400
4Subject: [PATCH] Avoid random test failures by running pngtest sequentially
5 only
6
7It is unreliable to run pngtest in parallel, due to competing writes
8to the same intermediate/output file ("pngout.png").
9
10Customization of this output file name should be possible, but it is
11currently broken.
12---
13 Makefile.am                            |  3 +--
14 Makefile.in                            | 16 ++++------------
15 tests/pngtest                          |  2 --
16 tests/{pngtest-badpngs => pngtest-all} |  6 +++++-
17 4 files changed, 10 insertions(+), 17 deletions(-)
18 rename tests/{pngtest-badpngs => pngtest-all} (80%)
19
20diff --git a/Makefile.am b/Makefile.am
21index 4f621aa..f21107e 100644
22--- a/Makefile.am
23+++ b/Makefile.am
24@@ -59,8 +59,7 @@ pngcp_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
25 # Generally these are single line shell scripts to run a test with a particular
26 # set of parameters:
27 TESTS =\
28-   tests/pngtest\
29-   tests/pngtest-badpngs\
30+   tests/pngtest-all\
31    tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\
32    tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\
33    tests/pngvalid-gamma-expand16-background\
34diff --git a/Makefile.in b/Makefile.in
35index 81ac1c8..31a82d2 100644
36--- a/Makefile.in
37+++ b/Makefile.in
38@@ -736,8 +736,7 @@ pngcp_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
39 # Generally these are single line shell scripts to run a test with a particular
40 # set of parameters:
41 TESTS = \
42-   tests/pngtest\
43-   tests/pngtest-badpngs\
44+   tests/pngtest-all\
45    tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\
46    tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\
47    tests/pngvalid-gamma-expand16-background\
48@@ -1578,16 +1577,9 @@ recheck: all $(check_PROGRAMS)
49 	        am__force_recheck=am--force-recheck \
50 	        TEST_LOGS="$$log_list"; \
51 	exit $$?
52-tests/pngtest.log: tests/pngtest
53-	@p='tests/pngtest'; \
54-	b='tests/pngtest'; \
55-	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
56-	--log-file $$b.log --trs-file $$b.trs \
57-	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
58-	"$$tst" $(AM_TESTS_FD_REDIRECT)
59-tests/pngtest-badpngs.log: tests/pngtest-badpngs
60-	@p='tests/pngtest-badpngs'; \
61-	b='tests/pngtest-badpngs'; \
62+tests/pngtest-all.log: tests/pngtest-all
63+	@p='tests/pngtest-all'; \
64+	b='tests/pngtest-all'; \
65 	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
66 	--log-file $$b.log --trs-file $$b.trs \
67 	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
68diff --git a/tests/pngtest b/tests/pngtest
69index 813973b..e69de29 100755
70--- a/tests/pngtest
71+++ b/tests/pngtest
72@@ -1,2 +0,0 @@
73-#!/bin/sh
74-exec ./pngtest --strict ${srcdir}/pngtest.png
75diff --git a/tests/pngtest-badpngs b/tests/pngtest-all
76similarity index 80%
77rename from tests/pngtest-badpngs
78rename to tests/pngtest-all
79index 7777523..a491ba5 100755
80--- a/tests/pngtest-badpngs
81+++ b/tests/pngtest-all
82@@ -1,5 +1,9 @@
83 #!/bin/sh
84
85+# normal execution
86+
87+./pngtest --strict ${srcdir}/pngtest.png
88+
89 # various crashers
90 # using --relaxed because some come from fuzzers that don't maintain CRC's
91
92@@ -10,4 +14,4 @@
93 ./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/huge_*_chunk.png \
94     ${srcdir}/contrib/testpngs/crashers/huge_*safe_to_copy.png
95
96-exec ./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/huge_IDAT.png
97+./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/huge_IDAT.png
98--
992.27.0
100
101