Merge branch 'msvc'
[platform/upstream/automake.git] / tests / parallel-am3.test
1 #! /bin/sh
2 # Copyright (C) 2008, 2009  Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # Test parallel automake execution.
18
19 # This tests:
20 # 3) normal automake output should be identical and ordered in the same way
21 #    with --add-missing, even with concurrent file requirements, and the
22 #    installation of aux files should be race-free,
23
24 required=perl-threads
25 . ./defs || Exit 1
26
27 set -e
28
29 cat > configure.in << 'END'
30 AC_INIT([parallel-am], [1.0])
31 AC_CONFIG_AUX_DIR([build-aux])
32 AM_INIT_AUTOMAKE
33 AC_PROG_CC
34 AM_PATH_LISPDIR
35 AM_PATH_PYTHON
36 AC_CONFIG_FILES([Makefile])
37 END
38
39 cat > Makefile.am << 'END'
40 SUBDIRS =
41 END
42
43 list='1 2 3'
44 for i in $list; do
45   echo "AC_CONFIG_FILES([sub$i/Makefile])" >> configure.in
46   echo "SUBDIRS += sub$i" >> Makefile.am
47   mkdir sub$i
48   cat > sub$i/Makefile.am <<END
49 python_PYTHON = foo$i.py
50 lisp_LISP = foo$i.el
51 bin_PROGRAMS = p$i
52 END
53 done
54
55 rm -f install-sh missing depcomp
56 mkdir build-aux
57
58 $ACLOCAL
59
60 # Generate expected output using the non-threaded code.
61 unset AUTOMAKE_JOBS || :
62 AUTOMAKE_run 0 --add-missing
63 mv stderr expected
64 mv Makefile.in Makefile.in.exp
65
66 AUTOMAKE_JOBS=3
67 export AUTOMAKE_JOBS
68
69 for run in 1 2 3 4 5 6 7; do
70   rm -f build-aux/* sub*/Makefile.in
71   AUTOMAKE_run 0 --add-missing
72   diff stderr expected
73   diff Makefile.in Makefile.in.exp
74 done
75
76 :