Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0bfa0b80
Commit
0bfa0b80
authored
May 25, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better support for building stand-alone tests.
parent
2a109307
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
16 deletions
+29
-16
test.h
include/wine/test.h
+25
-4
make_ctests.c
tools/make_ctests.c
+4
-12
No files found.
include/wine/test.h
View file @
0bfa0b80
...
...
@@ -39,7 +39,14 @@ extern int winetest_loop_todo(void);
extern
void
winetest_end_todo
(
const
char
*
platform
);
extern
int
winetest_get_mainargs
(
char
***
pargv
);
#ifdef STANDALONE
#define START_TEST(name) \
static void func_##name(void); \
static const struct test winetest_testlist[] = { { #name, func_##name }, { 0, 0 } }; \
static void func_##name(void)
#else
#define START_TEST(name) void func_##name(void)
#endif
#ifdef __GNUC__
...
...
@@ -72,7 +79,17 @@ extern void winetest_trace( const char *msg, ... );
* different includes or flags if needed.
*/
#ifdef WINETEST_WANT_MAIN
#ifdef STANDALONE
#include <stdio.h>
struct
test
{
const
char
*
name
;
void
(
*
func
)(
void
);
};
static
const
struct
test
winetest_testlist
[];
/* debug level */
int
winetest_debug
=
1
;
...
...
@@ -322,11 +339,15 @@ int main( int argc, char **argv )
if
((
p
=
getenv
(
"WINETEST_DEBUG"
)))
winetest_debug
=
atoi
(
p
);
if
((
p
=
getenv
(
"WINETEST_INTERACTIVE"
)))
winetest_interactive
=
atoi
(
p
);
if
((
p
=
getenv
(
"WINETEST_REPORT_SUCCESS"
)))
report_success
=
atoi
(
p
);
if
(
!
argv
[
1
])
usage
(
argv
[
0
]
);
if
(
!
argv
[
1
])
{
if
(
winetest_testlist
[
0
].
name
&&
!
winetest_testlist
[
1
].
name
)
/* only one test */
return
run_test
(
winetest_testlist
[
0
].
name
);
usage
(
argv
[
0
]
);
}
return
run_test
(
argv
[
1
]);
}
#endif
/*
WINETEST_WANT_MAIN
*/
#endif
/*
STANDALONE
*/
#endif
/* __WINE_TEST_H */
tools/make_ctests.c
View file @
0bfa0b80
...
...
@@ -122,19 +122,14 @@ int main( int argc, const char** argv )
"#include <stdio.h>
\n
"
"#include <stdlib.h>
\n
"
"#include
\"
windef.h
\"\n
"
"#include
\"
winbase.h
\"\n
"
"
\n
"
);
"#include
\"
winbase.h
\"\n\n
"
"#define STANDALONE
\n
"
"#include
\"
wine/test.h
\"\n\n
"
);
for
(
i
=
0
;
i
<
count
;
i
++
)
fprintf
(
out
,
"extern void func_%s(void);
\n
"
,
tests
[
i
]
);
fprintf
(
out
,
"
\n
"
"struct test
\n
"
"{
\n
"
" const char *name;
\n
"
" void (*func)(void);
\n
"
"};
\n
"
"
\n
"
"static const struct test winetest_testlist[] =
\n
"
"{
\n
"
);
...
...
@@ -142,10 +137,7 @@ int main( int argc, const char** argv )
fprintf
(
out
,
" { 0, 0 }
\n
"
"};
\n
"
"
\n
"
"#define WINETEST_WANT_MAIN
\n
"
"#include
\"
wine/test.h
\"\n
"
);
"};
\n
"
);
if
(
output_file
&&
fclose
(
out
))
fatal_perror
(
"error writing to %s"
,
output_file
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment