2 * Automated Testing Framework (atf)
4 * Copyright (c) 2009 The NetBSD Foundation, Inc.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
17 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #if defined(TESTS_ATF_ATF_C_H_BUILD_H)
31 # error "Cannot include h_build.h more than once."
33 # define TESTS_ATF_ATF_C_H_BUILD_H
36 /* ---------------------------------------------------------------------
38 * --------------------------------------------------------------------- */
40 static struct c_o_test
{
48 const char *const optargs
[16];
49 const char *const expargv
[16];
63 "cc", "-o", "test.o", "-c", "test.c", NULL
68 "Multi-word program name",
79 "cc", "-foo", "-o", "test.o", "-c", "test.c", NULL
95 "cc", "-f1", "-f2", "-f3", "-f4-f5", "-o", "test.o",
104 "-f1 -f2 -f3 -f4-f5",
112 "cc", "-f1", "-f2", "-f3", "-f4-f5", "-o", "test.o",
118 "Some cflags and cppflags",
129 "cc", "-f1", "-f2", "-o", "test.o", "-c", "test.c", NULL
134 "Some optional arguments",
145 "cc", "-o1", "-o2", "-o", "test.o", "-c", "test.c", NULL
150 "Some cflags, cppflags and optional arguments",
161 "cc", "-f1", "-f2", "-o1", "-o2", "-o", "test.o",
179 static struct cpp_test
{
182 const char *cppflags
;
186 const char *const optargs
[16];
187 const char *const expargv
[16];
200 "cpp", "-o", "test.out", "test.c", NULL
205 "Multi-word program name",
215 "cpp", "-foo", "-o", "test.out", "test.c", NULL
222 "-f1 -f2 -f3 -f4-f5",
230 "cpp", "-f1", "-f2", "-f3", "-f4-f5", "-o", "test.out",
236 "Some optional arguments",
246 "cpp", "-o1", "-o2", "-o", "test.out", "test.c", NULL
251 "Some cppflags and optional arguments",
261 "cpp", "-f1", "-o1", "-o2", "-o", "test.out", "test.c", NULL
277 static struct cxx_o_test
{
280 const char *cxxflags
;
281 const char *cppflags
;
285 const char *const optargs
[16];
286 const char *const expargv
[16];
300 "c++", "-o", "test.o", "-c", "test.c", NULL
305 "Multi-word program name",
316 "c++", "-foo", "-o", "test.o", "-c", "test.c", NULL
323 "-f1 -f2 -f3 -f4-f5",
332 "c++", "-f1", "-f2", "-f3", "-f4-f5", "-o", "test.o",
341 "-f1 -f2 -f3 -f4-f5",
349 "c++", "-f1", "-f2", "-f3", "-f4-f5", "-o", "test.o",
355 "Some cxxflags and cppflags",
366 "c++", "-f1", "-f2", "-o", "test.o", "-c", "test.c", NULL
371 "Some optional arguments",
382 "c++", "-o1", "-o2", "-o", "test.o", "-c", "test.c", NULL
387 "Some cxxflags, cppflags and optional arguments",
398 "c++", "-f1", "-f2", "-o1", "-o2", "-o", "test.o",