Moved __ASM_GLOBAL_FUNC macros and interlocked functions to port.[ch]
[wine] / include / wine / test.h
1 /*
2  * Definitions for Wine C unit tests.
3  *
4  * Copyright (C) 2002 Alexandre Julliard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef __WINE_TEST_H
22 #define __WINE_TEST_H
23
24 #include <stdarg.h>
25 #include "windef.h"
26
27 /* debug level */
28 extern int winetest_debug;
29
30 /* current platform */
31 extern const char *winetest_platform;
32
33 typedef int (*winetest_ok_funcptr)( int condition, const char *msg, ...);
34 typedef void (*winetest_trace_funcptr)( const char *msg, ...);
35
36 extern winetest_ok_funcptr winetest_set_ok_location( const char* file, int line );
37 extern winetest_trace_funcptr winetest_set_trace_location( const char* file, int line );
38 extern void winetest_start_todo( const char* platform );
39 extern int winetest_loop_todo(void);
40 extern void winetest_end_todo( const char* platform );
41 extern int winetest_get_mainargs( char*** pargv );
42
43 #define START_TEST(name) void func_##name(void)
44
45 #define ok             (*winetest_set_ok_location(__FILE__, __LINE__))
46 #define trace          (*winetest_set_trace_location(__FILE__, __LINE__))
47
48 #define todo(platform) for (winetest_start_todo(platform); \
49                             winetest_loop_todo(); \
50                             winetest_end_todo(platform))
51 #define todo_wine      todo("wine")
52
53 #endif  /* __WINE_TEST_H */