From: Rémi Bernon rbernon@codeweavers.com
--- dlls/combase/tests/wine.combase.test.c | 4 +++ dlls/dinput/tests/driver_bus.c | 4 +++ dlls/dinput/tests/driver_hid.c | 4 +++ dlls/dinput/tests/driver_hid_poll.c | 4 +++ dlls/imagehlp/tests/testdll.c | 4 +++ dlls/imm32/tests/ime_wrapper.c | 4 +++ dlls/imm32/tests/ime_wrapper.rc | 2 -- dlls/kernel32/tests/dummy.c | 22 +++++++++++++++ dlls/msi/tests/custom.c | 4 +++ dlls/msi/tests/selfreg.c | 4 +++ dlls/ntoskrnl.exe/tests/driver.c | 4 +++ dlls/ntoskrnl.exe/tests/driver2.c | 4 +++ dlls/ntoskrnl.exe/tests/driver3.c | 4 +++ dlls/ntoskrnl.exe/tests/driver_netio.c | 4 +++ dlls/ntoskrnl.exe/tests/driver_pnp.c | 4 +++ dlls/ole32/tests/testlib.c | 4 +++ dlls/setupapi/tests/coinst.c | 4 +++ dlls/setupapi/tests/selfreg.c | 4 +++ dlls/ucrtbase/tests/threaddll.c | 4 +++ tools/makedep.c | 37 +++++++++++++++----------- 20 files changed, 112 insertions(+), 17 deletions(-)
diff --git a/dlls/combase/tests/wine.combase.test.c b/dlls/combase/tests/wine.combase.test.c index e6171c6c6e7..3106a61b648 100644 --- a/dlls/combase/tests/wine.combase.test.c +++ b/dlls/combase/tests/wine.combase.test.c @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include <stdarg.h> #include <stddef.h>
diff --git a/dlls/dinput/tests/driver_bus.c b/dlls/dinput/tests/driver_bus.c index 44a14798337..c0d181c58a5 100644 --- a/dlls/dinput/tests/driver_bus.c +++ b/dlls/dinput/tests/driver_bus.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include <stdarg.h> #include <stdio.h>
diff --git a/dlls/dinput/tests/driver_hid.c b/dlls/dinput/tests/driver_hid.c index 8f015eb5ddf..5c1bda6871e 100644 --- a/dlls/dinput/tests/driver_hid.c +++ b/dlls/dinput/tests/driver_hid.c @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include <stdarg.h> #include <stdio.h>
diff --git a/dlls/dinput/tests/driver_hid_poll.c b/dlls/dinput/tests/driver_hid_poll.c index b5cf46f389e..aad1c6ee0e6 100644 --- a/dlls/dinput/tests/driver_hid_poll.c +++ b/dlls/dinput/tests/driver_hid_poll.c @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include <stdarg.h> #include <stdio.h>
diff --git a/dlls/imagehlp/tests/testdll.c b/dlls/imagehlp/tests/testdll.c index 3c079bfffd3..58e852b268d 100644 --- a/dlls/imagehlp/tests/testdll.c +++ b/dlls/imagehlp/tests/testdll.c @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include <oaidl.h> #include <commdlg.h> #include <shlwapi.h> diff --git a/dlls/imm32/tests/ime_wrapper.c b/dlls/imm32/tests/ime_wrapper.c index d8a03499549..8d5eb498809 100644 --- a/dlls/imm32/tests/ime_wrapper.c +++ b/dlls/imm32/tests/ime_wrapper.c @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include "ime_test.h"
struct ime_functions ime_functions = {0}; diff --git a/dlls/imm32/tests/ime_wrapper.rc b/dlls/imm32/tests/ime_wrapper.rc index e71d81f4fc9..2ef04be21c5 100644 --- a/dlls/imm32/tests/ime_wrapper.rc +++ b/dlls/imm32/tests/ime_wrapper.rc @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#pragma makedep testdll - #define WINE_LANGID 047f /* LANG_INVARIANT/SUBLANG_DEFAULT */ #define WINE_FILETYPE VFT_DRV #define WINE_FILESUBTYPE VFT2_DRV_INPUTMETHOD diff --git a/dlls/kernel32/tests/dummy.c b/dlls/kernel32/tests/dummy.c index b8eab8c219e..4837a3736ba 100644 --- a/dlls/kernel32/tests/dummy.c +++ b/dlls/kernel32/tests/dummy.c @@ -1,3 +1,25 @@ +/* + * Copyright 2019 Fabian Maurer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep testdll +#endif + #include <windows.h>
static HINSTANCE instance; diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index 30b9040acff..ef24de5cc22 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include <stdarg.h> #include <stdio.h>
diff --git a/dlls/msi/tests/selfreg.c b/dlls/msi/tests/selfreg.c index 668e742e9ba..2f5e6f48ef1 100644 --- a/dlls/msi/tests/selfreg.c +++ b/dlls/msi/tests/selfreg.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include <stdarg.h> #include <windef.h> #include <winbase.h> diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c index bd388a6ec9e..5275aada3dc 100644 --- a/dlls/ntoskrnl.exe/tests/driver.c +++ b/dlls/ntoskrnl.exe/tests/driver.c @@ -20,6 +20,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include <stdarg.h> #include <stdio.h>
diff --git a/dlls/ntoskrnl.exe/tests/driver2.c b/dlls/ntoskrnl.exe/tests/driver2.c index c648ec60ffc..56260d711df 100644 --- a/dlls/ntoskrnl.exe/tests/driver2.c +++ b/dlls/ntoskrnl.exe/tests/driver2.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include <stdarg.h>
#include "ntstatus.h" diff --git a/dlls/ntoskrnl.exe/tests/driver3.c b/dlls/ntoskrnl.exe/tests/driver3.c index a7737a960a0..917a1dbec6b 100644 --- a/dlls/ntoskrnl.exe/tests/driver3.c +++ b/dlls/ntoskrnl.exe/tests/driver3.c @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include <stdarg.h>
#include "ntstatus.h" diff --git a/dlls/ntoskrnl.exe/tests/driver_netio.c b/dlls/ntoskrnl.exe/tests/driver_netio.c index 9f9478d75b0..365c90a05ab 100644 --- a/dlls/ntoskrnl.exe/tests/driver_netio.c +++ b/dlls/ntoskrnl.exe/tests/driver_netio.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include <stdarg.h> #include <stdio.h>
diff --git a/dlls/ntoskrnl.exe/tests/driver_pnp.c b/dlls/ntoskrnl.exe/tests/driver_pnp.c index 77332708fd3..f66d56de8c7 100644 --- a/dlls/ntoskrnl.exe/tests/driver_pnp.c +++ b/dlls/ntoskrnl.exe/tests/driver_pnp.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include <stdarg.h> #include <stdio.h>
diff --git a/dlls/ole32/tests/testlib.c b/dlls/ole32/tests/testlib.c index 9631f81c9c3..0d5c915d12f 100644 --- a/dlls/ole32/tests/testlib.c +++ b/dlls/ole32/tests/testlib.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include <stdio.h> #include <windows.h> #include <initguid.h> diff --git a/dlls/setupapi/tests/coinst.c b/dlls/setupapi/tests/coinst.c index ba526a5d3a1..82597b7bc54 100644 --- a/dlls/setupapi/tests/coinst.c +++ b/dlls/setupapi/tests/coinst.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include <stdarg.h> #include "windef.h" #include "winbase.h" diff --git a/dlls/setupapi/tests/selfreg.c b/dlls/setupapi/tests/selfreg.c index f687990f3bc..3e45d661483 100644 --- a/dlls/setupapi/tests/selfreg.c +++ b/dlls/setupapi/tests/selfreg.c @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #define COBJMACROS #include "msxml.h"
diff --git a/dlls/ucrtbase/tests/threaddll.c b/dlls/ucrtbase/tests/threaddll.c index 72b8074054a..387a00bff03 100644 --- a/dlls/ucrtbase/tests/threaddll.c +++ b/dlls/ucrtbase/tests/threaddll.c @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#if 0 +#pragma makedep testdll +#endif + #include <windows.h>
#include "threaddll.h" diff --git a/tools/makedep.c b/tools/makedep.c index d3064ea4ff1..41f1756686f 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -100,6 +100,7 @@ struct incl_file #define FLAG_C_IMPLIB 0x040000 /* file is part of an import library */ #define FLAG_C_UNIX 0x080000 /* file is part of a Unix library */ #define FLAG_SFD_FONTS 0x100000 /* sfd file generated bitmap fonts */ +#define FLAG_C_TESTDLL 0x200000 /* file is part of a TESTDLL resource */
static const struct { @@ -965,6 +966,7 @@ static void parse_pragma_directive( struct file *source, char *str ) { if (!strcmp( flag, "implib" )) source->flags |= FLAG_C_IMPLIB; if (!strcmp( flag, "unix" )) source->flags |= FLAG_C_UNIX; + if (!strcmp( flag, "testdll" )) source->flags |= FLAG_C_TESTDLL; } } } @@ -3058,15 +3060,16 @@ static void output_source_in( struct makefile *make, struct incl_file *source, c
/******************************************************************* - * output_source_spec + * output_source_testdll */ -static void output_source_spec( struct makefile *make, struct incl_file *source, const char *obj ) +static void output_source_testdll( struct makefile *make, struct incl_file *source, const char *obj ) { struct strarray imports = get_expanded_file_local_var( make, obj, "IMPORTS" ); struct strarray dll_flags = empty_strarray; struct strarray default_imports = empty_strarray; struct strarray all_libs, dep_libs; const char *dll_name, *obj_name, *res_name, *output_rsrc, *output_file, *debug_file; + struct incl_file *spec_file = find_src_file( make, replace_extension( source->name, ".c", ".spec" ) ); unsigned int arch;
if (!imports.count) imports = make->imports; @@ -3074,6 +3077,8 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, strarray_addall( &dll_flags, get_expanded_file_local_var( make, obj, "EXTRADLLFLAGS" )); if (!strarray_exists( &dll_flags, "-nodefaultlibs" )) default_imports = get_default_imports( make, imports );
+ if (!spec_file) fatal_error( "testdll source %s needs a .spec file\n", source->name ); + for (arch = 0; arch < archs.count; arch++) { if (!is_multiarch( arch )) continue; @@ -3099,7 +3104,7 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, tools_path( make, "wrc" ));
output( "%s:", output_file ); - output_filename( source->filename ); + output_filename( spec_file->filename ); output_filename( obj_name ); if (res_name) output_filename( res_name ); output_filenames( dep_libs ); @@ -3111,7 +3116,7 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, output_filenames( dll_flags ); if (arch) output_filenames( get_expanded_arch_var_array( make, "EXTRADLLFLAGS", arch )); output_filename( "-shared" ); - output_filename( source->filename ); + output_filename( spec_file->filename ); output_filename( obj_name ); if (res_name) output_filename( res_name ); if ((debug_file = get_debug_file( make, dll_name, arch ))) @@ -3143,7 +3148,7 @@ static void output_source_xml( struct makefile *make, struct incl_file *source, */ static void output_source_one_arch( struct makefile *make, struct incl_file *source, const char *obj, struct strarray defines, struct strarray *targets, - unsigned int arch, int is_dll_src ) + unsigned int arch ) { const char *obj_name;
@@ -3171,7 +3176,7 @@ static void output_source_one_arch( struct makefile *make, struct incl_file *sou strarray_add( &make->unixobj_files, obj_name ); else if (source->file->flags & FLAG_C_IMPLIB) strarray_add( &make->implib_files[arch], obj_name ); - else if (!is_dll_src) + else if (!(source->file->flags & FLAG_C_TESTDLL)) strarray_add( &make->object_files[arch], obj_name ); else strarray_add( &make->clean_files, obj_name ); @@ -3204,8 +3209,8 @@ static void output_source_one_arch( struct makefile *make, struct incl_file *sou output_filename( arch_make_variable( "CFLAGS", arch )); output( "\n" );
- if (make->testdll && !is_dll_src && strendswith( source->name, ".c" ) && - !(source->file->flags & FLAG_GENERATED)) + if (make->testdll && strendswith( source->name, ".c" ) && + !(source->file->flags & (FLAG_GENERATED | FLAG_C_TESTDLL))) { const char *ok_file, *test_exe;
@@ -3228,22 +3233,25 @@ static void output_source_default( struct makefile *make, struct incl_file *sour { struct strarray defines = get_source_defines( make, source, obj ); struct strarray targets = empty_strarray; - int is_dll_src = (make->testdll && strendswith( source->name, ".c" ) && - find_src_file( make, replace_extension( source->name, ".c", ".spec" ))); unsigned int arch;
- for (arch = 0; arch < archs.count; arch++) - if (!source->arch || source->arch == arch) - output_source_one_arch( make, source, obj, defines, &targets, arch, is_dll_src ); + if (!strendswith( source->name, ".spec" )) + { + for (arch = 0; arch < archs.count; arch++) + if (!source->arch || source->arch == arch) + output_source_one_arch( make, source, obj, defines, &targets, arch ); + }
if (source->file->flags & FLAG_GENERATED) { if (!make->testdll || !strendswith( source->filename, "testlist.c" )) strarray_add( &make->clean_files, source->basename ); } + else if (source->file->flags & FLAG_C_TESTDLL) + output_source_testdll( make, source, obj ); else { - if (make->testdll && !is_dll_src && strendswith( source->name, ".c" )) + if (make->testdll && strendswith( source->name, ".c" )) strarray_add( &make->test_files, obj ); }
@@ -3280,7 +3288,6 @@ static const struct { "po", output_source_po }, { "in", output_source_in }, { "x", output_source_x }, - { "spec", output_source_spec }, { "xml", output_source_xml }, { NULL, output_source_default } };