Alexandre Julliard : makefiles: Add a separate variable to keep track of source test files.

Alexandre Julliard julliard at winehq.org
Mon Nov 22 16:05:16 CST 2021


Module: wine
Branch: master
Commit: 859338a4d4810965cbfb521c0a7cbf7fbfb07a21
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=859338a4d4810965cbfb521c0a7cbf7fbfb07a21

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sat Nov 20 13:26:51 2021 +0100

makefiles: Add a separate variable to keep track of source test files.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/makedep.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/makedep.c b/tools/makedep.c
index acc8f49bfba..bf8d3a126e3 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -206,6 +206,7 @@ struct makefile
     struct strarray in_files;
     struct strarray ok_files;
     struct strarray pot_files;
+    struct strarray test_files;
     struct strarray clean_files;
     struct strarray distclean_files;
     struct strarray uninstall_files;
@@ -3016,6 +3017,7 @@ static void output_source_default( struct makefile *make, struct incl_file *sour
         strarray_add( &make->c2man_files, source->filename );
         if (make->testdll && !is_dll_src)
         {
+            strarray_add( &make->test_files, obj );
             strarray_add( &make->ok_files, strmake( "%s.ok", obj ));
             output( "%s.ok:\n", obj_dir_path( make, obj ));
             output( "\t%s%s $(RUNTESTFLAGS) -T . -M %s -p %s%s %s && touch $@\n",
@@ -3886,12 +3888,8 @@ static void output_linguas( const struct makefile *make )
 static void output_testlist( const struct makefile *make )
 {
     const char *dest = obj_dir_path( make, "testlist.c" );
-    struct strarray files = empty_strarray;
     unsigned int i;
 
-    for (i = 0; i < make->ok_files.count; i++)
-        strarray_add( &files, replace_extension( make->ok_files.str[i], ".ok", "" ));
-
     output_file = create_temp_file( dest );
 
     output( "/* Automatically generated by make depend; DO NOT EDIT!! */\n\n" );
@@ -3900,11 +3898,13 @@ static void output_testlist( const struct makefile *make )
     output( "#define STANDALONE\n" );
     output( "#include \"wine/test.h\"\n\n" );
 
-    for (i = 0; i < files.count; i++) output( "extern void func_%s(void);\n", files.str[i] );
+    for (i = 0; i < make->test_files.count; i++)
+        output( "extern void func_%s(void);\n", make->test_files.str[i] );
     output( "\n" );
     output( "const struct test winetest_testlist[] =\n" );
     output( "{\n" );
-    for (i = 0; i < files.count; i++) output( "    { \"%s\", func_%s },\n", files.str[i], files.str[i] );
+    for (i = 0; i < make->test_files.count; i++)
+        output( "    { \"%s\", func_%s },\n", make->test_files.str[i], make->test_files.str[i] );
     output( "    { 0, 0 }\n" );
     output( "};\n" );
 
@@ -3960,7 +3960,7 @@ static void output_stub_makefile( struct makefile *make )
     if (make->install_rules[INSTALL_LIB].count) strarray_add( &targets, "install-lib" );
     if (make->install_rules[INSTALL_DEV].count) strarray_add( &targets, "install-dev" );
     if (make->clean_files.count) strarray_add( &targets, "clean" );
-    if (make->ok_files.count)
+    if (make->test_files.count)
     {
         strarray_add( &targets, "check" );
         strarray_add( &targets, "test" );




More information about the wine-cvs mailing list