From 598a21be9cabd215d0d595b0ca768b795e321f8c Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Fri, 12 Feb 2021 17:14:29 +0100 Subject: [PATCH] tests: Add ignore_exceptions(). This lets tests signal that for a while exceptions are expected and should not be counted as test failures. Signed-off-by: Francois Gouget Signed-off-by: Alexandre Julliard (cherry picked from commit 4ac37c4e24cf980717a982c22076cc4a5adffdd5) Signed-off-by: Michael Stefaniuc --- include/wine/test.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/wine/test.h b/include/wine/test.h index c10050012b6..078b0147c4f 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;