Hierarchical namespace for tests

Paul Millar p.millar at physics.gla.ac.uk
Sat Apr 23 08:49:54 CDT 2005


Hi,

Hopefully not a controversial one.  I think it will prove useful to separate the
different tests' namespace.  This would allow identical filenames to appear
in different DLL tests directories without confusion (c.f. "generated.c"
currently).

The proposed namespace would be simply
   <dllname> "/" <filename> ":" <lineno>
Examples are:
   user/sysparams:186
   winspool/info:128

Cheers,

Paul.

Changelog:
  Add hierarchical namespace for tests.

Index: dlls/Maketest.rules.in
===================================================================
RCS file: /home/wine/wine/dlls/Maketest.rules.in,v
retrieving revision 1.35
diff -u -r1.35 Maketest.rules.in
--- dlls/Maketest.rules.in	16 Mar 2005 20:02:17 -0000	1.35
+++ dlls/Maketest.rules.in	22 Apr 2005 22:22:54 -0000
@@ -9,7 +9,7 @@
 # plus all variables required by the global Make.rules.in
 #
 
-DLLDEFS      = @DLLDEFS@
+DLLDEFS      = @DLLDEFS@ -DTESTDLL=$(TESTDLL:%.dll=%)
 DLLFLAGS     = @DLLFLAGS@
 DEFS         = $(DLLDEFS) $(EXTRADEFS)
 
Index: include/wine/test.h
===================================================================
RCS file: /home/wine/wine/include/wine/test.h,v
retrieving revision 1.14
diff -u -r1.14 test.h
--- include/wine/test.h	3 May 2004 20:19:13 -0000	1.14
+++ include/wine/test.h	22 Apr 2005 22:22:55 -0000
@@ -74,6 +74,15 @@
 
 #ifdef WINETEST_WANT_MAIN
 
+#ifdef TESTDLL
+#define TESTDLL_STR(A) #A
+#define TESTDLL_XSTR(A) TESTDLL_STR(A)
+#define TESTDLLNAME TESTDLL_XSTR(TESTDLL)
+#else
+#define TESTDLLNAME "unknown"
+#endif
+
+
 /* debug level */
 int winetest_debug = 1;
 
@@ -162,8 +171,8 @@
     {
         if (condition)
         {
-            fprintf( stdout, "%s:%d: Test succeeded inside todo block",
-                     data->current_file, data->current_line );
+            fprintf( stdout, "%s/%s:%d: Test succeeded inside todo block",
+                     TESTDLLNAME, data->current_file, data->current_line );
             if (msg[0])
             {
                 va_start(valist, msg);
@@ -180,8 +189,8 @@
     {
         if (!condition)
         {
-            fprintf( stdout, "%s:%d: Test failed",
-                     data->current_file, data->current_line );
+            fprintf( stdout, "%s/%s:%d: Test failed",
+                     TESTDLLNAME, data->current_file, data->current_line );
             if (msg[0])
             {
                 va_start(valist, msg);
@@ -195,8 +204,8 @@
         else
         {
             if (report_success)
-                fprintf( stdout, "%s:%d: Test succeeded\n",
-                         data->current_file, data->current_line);
+                fprintf( stdout, "%s/%s:%d: Test succeeded\n",
+                                 TESTDLLNAME, data->current_file, data->current_line);
             InterlockedIncrement(&successes);
         }
     }
@@ -210,7 +219,7 @@
 
     if (winetest_debug > 0)
     {
-        fprintf( stdout, "%s:%d:", data->current_file, data->current_line );
+        fprintf( stdout, "%s/%s:%d:", TESTDLLNAME, data->current_file, data->current_line );
         va_start(valist, msg);
         vfprintf(stdout, msg, valist);
         va_end(valist);
@@ -286,8 +295,8 @@
 
     if (winetest_debug)
     {
-        fprintf( stdout, "%s: %ld tests executed, %ld marked as todo, %ld %s.\n",
-                 name, successes + failures + todo_successes + todo_failures,
+        fprintf( stdout, "%s/%s: %ld tests executed, %ld marked as todo, %ld %s.\n",
+                 TESTDLLNAME, name, successes + failures + todo_successes + todo_failures,
                  todo_successes, failures + todo_failures,
                  (failures + todo_failures != 1) ? "failures" : "failure" );
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20050423/71a0fea3/attachment.pgp


More information about the wine-patches mailing list