2 # Copyright (C) 2012-2017 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Check performance of recheck target in the face of many failed tests.
18 # FIXME: this test is not currently able to detect whether the measured
19 # FIXME: performance is too low, and FAIL accordingly; it just offers an
20 # FIXME: easy way to verify how effective a performance optimization is.
26 cat >> configure.ac
<<'END'
30 cat > Makefile.am
<<END
31 count_expected = $count
37 # This should ensure that our timing won't be disturbed by the time
38 # that would be actually required to run any of:
40 # - the test driver executing them
41 # - the recipe to create the final test-suite log.
42 cat >> Makefile.am
<< 'END'
43 AUTOMAKE_OPTIONS
= -Wno-override
44 ## These should never be run.
45 T_LOG_COMPILER
= false
48 # The recipe of this also serves as a sanity check.
51 @
echo "RE-RUN:"; for i
in $
(TEST_LOGS
); do echo " $$i"; done
52 ## All the test cases should have been re-run.
53 @count_got
=`for i in $(TEST_LOGS); do echo $$i; done | wc -l` \
54 && echo "Count expected: $(count_expected)" \
55 && echo "Count obtained: $$count_got" \
56 && test $
$count_got -eq $
(count_expected
)
57 ## Pre-existing log files of the tests to re-run should have been
58 ## removed by the 'recheck' target
59 @
for i
in $
(TEST_LOGS
); do \
60 test ! -f $
$i.log ||
{ echo "$$i.log exists!"; exit 1; }; \
62 ## Actually create the target file, for extra safety.
69 # Temporarily disable shell traces, to avoid bloating the log file.
72 for i
in $
(seq_
1 $count); do
73 echo dummy
$i > $i.log
74 echo :global-test-result
: PASS
> $i.trs
75 echo :test-result
: PASS
>> $i.trs
76 echo :recheck
: yes >> $i.trs
77 echo TESTS
+= $i.t
>> Makefile.am
81 # Re-enable shell traces.
84 # So that we don't need to create a ton of dummy tests.
85 echo '$(TESTS):' >> Makefile.am
87 head -n 100 Makefile.am ||
: # For debugging.
88 tail -n 100 Makefile.am ||
: # Likewise.
89 cat $count.trs
# Likewise, just the last specimen though.