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 <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 4ac37c4e24
)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
parent
0aabd08c53
commit
598a21be9c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue