doc: update Vala documentation
[automake.git] / t / parallel-tests-log-compiler-2.sh
blob34177e28c054af900a5423e0c75fc20c63975da2
1 #! /bin/sh
2 # Copyright (C) 2009-2024 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 # Check parallel-tests features:
18 # - per-extension "test runners" a.k.a. "log compilers" (xxx_LOG_COMPILER
19 # and xxx_LOG_FLAGS), when some tests are PROGRAMS.
20 # See also related test 'parallel-tests-log-compiler-1.sh'.
22 required='cc native'
23 . test-init.sh
25 cat >> configure.ac << 'END'
26 AC_PROG_CC
27 AC_OUTPUT
28 END
30 cat > Makefile.am << 'END'
31 ## Note that automake should not match the '/test' part
32 ## of 'sub/test' as '.test' suffix.
33 TESTS = foo.chk bar.test $(check_PROGRAMS) sub/test
34 check_PROGRAMS = baz bla.test bli.suff
35 TEST_EXTENSIONS = .chk .test
36 CHK_LOG_COMPILER = ./chk-compiler
37 TEST_LOG_COMPILER = ./test-compiler
38 LOG_COMPILER = ./noext-compiler
39 AM_CHK_LOG_FLAGS = 1
40 CHK_LOG_FLAGS = 2
41 AM_TEST_LOG_FLAGS = 3
42 TEST_LOG_FLAGS = 4
43 AM_LOG_FLAGS = 5
44 LOG_FLAGS = 6
45 END
47 mkdir sub
49 cat >chk-compiler <<'END'
50 #! /bin/sh
51 echo $0 "$@"
52 shift
53 shift
54 exec "$@"
55 exit 127
56 END
57 chmod a+x chk-compiler
58 cp chk-compiler test-compiler
59 cp chk-compiler noext-compiler
61 cat >foo.chk << 'END'
62 #! /bin/sh
63 exit 0
64 END
65 chmod a+x foo.chk
66 cp foo.chk bar.test
67 cp foo.chk sub/test
69 cat >baz.c << 'END'
70 int main (void)
72 return 0;
74 END
75 cp baz.c bla.c
76 cp baz.c bli.c
78 $ACLOCAL
79 $AUTOCONF
80 $AUTOMAKE -a
82 ./configure
84 $MAKE
85 $MAKE check || { cat test-suite.log; exit 1; }
86 ls -l . sub
87 cat test-suite.log
88 grep 'chk-compiler *1 *2' foo.log
89 grep 'test-compiler *3 *4' bar.log
90 grep 'noext-compiler *5 *6' baz.log
91 grep 'test-compiler *3 *4' bla.log
92 grep 'noext-compiler *5 *6' bli.suff.log
93 grep 'noext-compiler *5 *6' sub/test.log