spawn: Use special invocation for <spawn.h> on OS/2 kLIBC.
[gnulib.git] / tests / test-execvpe-main.c
blob9b4eca28a7f0986bdce59eb5ca44653da9f28bb4
1 /* Test of execvpe().
2 Copyright (C) 2020-2021 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 3, 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 /* Written by Bruno Haible <bruno@clisp.org>, 2020. */
19 #include <config.h>
21 /* Specification. */
22 #include <unistd.h>
24 #include "signature.h"
25 SIGNATURE_CHECK (execvpe, int, (const char *, char * const *, char * const *));
27 #include <stdio.h>
29 int
30 main ()
32 const char *progname = "test-exec-child";
33 const char *env[3] = { "PATH=.", "Hommingberg=Gepardenforelle", NULL };
34 const char *argv[12] =
36 progname,
37 "abc def",
38 "abc\"def\"ghi",
39 "xyz\"",
40 "abc\\def\\ghi",
41 "xyz\\",
42 "???",
43 "***",
44 "",
45 "foo",
46 "",
47 NULL
49 execvpe (progname, (char * const *) argv, (char * const *) env);
51 perror ("execvpe");
52 return 1;