2 # Copyright (C) 2009-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 <https://www.gnu.org/licenses/>.
17 # Check parallel-tests features:
18 # - concurrent parallel execution
20 # FIXME: we should factor out (into am-test-lib.sh?) the code to determine
21 # how to run make in parallel mode ...
26 *\
-j*) skip_
"\$MAKE contains '-j'";;
32 unindent
> Makefile
<<END
39 for j
in "-j" "-j " NONE
; do
40 if test x
"$j" = xNONE
; then
41 skip_
"can't run make in parallel mode"
43 run_make
-M -- ${j}2 all ||
continue
44 $EGREP -i "(warning|error):|-j[\"\'\` ]" output
&& continue
47 rm -f one output Makefile
50 cat >> configure.ac
<< 'END'
54 cat > Makefile.am
<< 'END'
61 # Creative quoting below to please maintainer-check.
69 echo "TESTS += foo$i.test" >> Makefile.am
71 echo "TESTS += zap$i" >> Makefile.am
73 echo "TESTS += sub/bar$i.test" >> Makefile.am
75 echo "TESTS += sub/mu$i" >> Makefile.am
83 for build
in serial parallel
; do
92 # Do *not* use "make -j1" here; apparently, some make implementations
93 # (e.g., AIX 7.1) interpret it as a synonym of "make -j" :-(
99 run_make
-O -- ${j}4 check
102 # Ensure the tests are really being run in parallel mode: if this is
103 # the case, the serial run of the dummy testsuite started above should
104 # still be ongoing when the parallel one has terminated.
107 test $
(grep -c '^PASS:' parallel
/stdout
) -eq 12
109 # Wait long enough so that there are no open files any more when the
110 # post-test cleanup runs. But exit after we've waited for two minutes
111 # or more, to avoid testsuite hangs in unusual situations (this has
114 while test ! -f serial
/test-suite.log
&& test $i -le 120; do
116 sleep '1' # Extra quoting to please maintainer-check.