Updated winetest Perl modules using winapi_extract.
[wine] / programs / winetest / make_ctests
1 #!/usr/bin/perl
2 #
3 # Script to generate a C file containing a list of tests
4 #
5 # Copyright 2002 Alexandre Julliard
6 #
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20 #
21
22 use strict;
23
24 print "/* Automatically generated file; DO NOT EDIT!! */\n\n";
25
26 my @testlist = @ARGV;
27 foreach (@testlist)
28 {
29     s!.*/([^/]+)\.c$!$1!;
30     printf "extern void func_%s(void);\n", $_;
31 }
32
33 print <<EOF;
34
35 const struct
36 {
37     const char *name;
38     void (*func)(void);
39 } winetest_testlist[] =
40 {
41 EOF
42
43 foreach (@testlist)
44 {
45     printf "    { \"%s\", func_%s },\n", $_, $_;
46 }
47 print "    { 0, 0 }\n};\n";