[PATCH 1/2] tests: Add ignore_exceptions().

Francois Gouget fgouget at codeweavers.com
Fri Feb 12 10:14:29 CST 2021


This lets tests signal that for a while exceptions are expected and
should not be counted as test failures.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 include/wine/test.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/wine/test.h b/include/wine/test.h
index 787fea0ba24..4408366566c 100644
--- a/include/wine/test.h
+++ b/include/wine/test.h
@@ -61,6 +61,7 @@ extern const char *winetest_platform;
 
 extern void winetest_set_location( const char* file, int line );
 extern void winetest_subtest( const char* name );
+extern void winetest_ignore_exceptions( BOOL ignore );
 extern void winetest_start_todo( int is_todo );
 extern int winetest_loop_todo(void);
 extern void winetest_end_todo(void);
@@ -97,6 +98,7 @@ extern void __winetest_cdecl winetest_trace( const char *msg, ... ) __WINE_PRINT
 
 #ifdef WINETEST_NO_LINE_NUMBERS
 # define subtest_(file, line)  (winetest_set_location(file, 0), 0) ? (void)0 : winetest_subtest
+# define ignore_exceptions_(file, line)  (winetest_set_location(file, 0), 0) ? (void)0 : winetest_ignore_exceptions
 # define ok_(file, line)       (winetest_set_location(file, 0), 0) ? (void)0 : winetest_ok
 # define skip_(file, line)     (winetest_set_location(file, 0), 0) ? (void)0 : winetest_skip
 # define win_skip_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_win_skip
@@ -104,6 +106,7 @@ extern void __winetest_cdecl winetest_trace( const char *msg, ... ) __WINE_PRINT
 # define wait_child_process_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_wait_child_process
 #else
 # define subtest_(file, line)  (winetest_set_location(file, line), 0) ? (void)0 : winetest_subtest
+# define ignore_exceptions_(file, line)  (winetest_set_location(file, line), 0) ? (void)0 : winetest_ignore_exceptions
 # define ok_(file, line)       (winetest_set_location(file, line), 0) ? (void)0 : winetest_ok
 # define skip_(file, line)     (winetest_set_location(file, line), 0) ? (void)0 : winetest_skip
 # define win_skip_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_win_skip
@@ -112,6 +115,7 @@ extern void __winetest_cdecl winetest_trace( const char *msg, ... ) __WINE_PRINT
 #endif
 
 #define subtest  subtest_(__FILE__, __LINE__)
+#define ignore_exceptions  ignore_exceptions_(__FILE__, __LINE__)
 #define ok       ok_(__FILE__, __LINE__)
 #define skip     skip_(__FILE__, __LINE__)
 #define win_skip win_skip_(__FILE__, __LINE__)
@@ -298,6 +302,14 @@ void winetest_subtest( const char* name )
             data->current_file, data->current_line, winetest_elapsed(), name );
 }
 
+void winetest_ignore_exceptions( BOOL ignore )
+{
+    struct tls_data *data = get_tls_data();
+    printf( "%s:%d:%s IgnoreExceptions=%d\n",
+            data->current_file, data->current_line, winetest_elapsed(),
+            ignore ? 1 : 0 );
+}
+
 int broken( int condition )
 {
     return (strcmp(winetest_platform, "windows") == 0) && condition;
-- 
2.20.1




More information about the wine-devel mailing list