tests: Let 'ltorder.sh' run successfully with Guix dynamic loader
[automake.git] / t / parallel-am2.sh
blobcac928861a35355b8150b87298645e67e11efe5a
1 #! /bin/sh
2 # Copyright (C) 2008-2018 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)
7 # any later version.
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 # Test parallel automake execution.
19 # This tests:
20 # 4) warning and normal error output should be identical, in that duplicate
21 # warnings should be omitted in the same way as without threads.
23 required=perl-threads
24 . test-init.sh
26 mkdir sub
28 cat > Makefile.am << 'END'
29 AUTOMAKE_OPTIONS = subdir-objects
30 bin_PROGRAMS = main
31 main_SOURCES = sub/main.c
32 SUBDIRS =
33 END
35 list='1 2 3'
36 for i in $list; do
37 echo "AC_CONFIG_FILES([sub$i/Makefile])" >> configure.ac
38 echo "SUBDIRS += sub$i" >> Makefile.am
39 mkdir sub$i sub$i/sub
40 unindent > sub$i/Makefile.am << END
41 AUTOMAKE_OPTIONS = subdir-objects
42 bin_PROGRAMS = sub$i
43 sub${i}_SOURCES = sub/main$i.c
44 END
45 done
47 mkdir build-aux
49 $ACLOCAL
51 # Independently of the number of worker threads, automake output
52 # should be
53 # - stable (multiple runs should produce the same output),
54 # - properly uniquified,
55 # - complete (output from worker threads should not be lost).
57 # The parts output by --add-missing are unstable not only wrt. order
58 # but also wrt. content: any of the Makefile.am files may cause the
59 # depcomp script to be installed (or several of them).
60 # Thus we install the auxiliary files in a prior step.
62 # Generate expected output using non-threaded code.
63 unset AUTOMAKE_JOBS
64 rm -f install-sh missing depcomp
65 AUTOMAKE_fails --add-missing
66 mv stderr expected
68 AUTOMAKE_JOBS=5
69 export AUTOMAKE_JOBS
71 for i in 1 2 3 4 5 6 7 8; do
72 rm -f install-sh missing depcomp
73 AUTOMAKE_fails --add-missing
74 diff expected stderr
75 done