mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-09-13 09:16:14 -07:00
tests: Introduce VKD3D_TEST_FILTER.
Useful for running a subset of tests. Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0d851513dc
commit
b71120d78d
4
README
4
README
@ -65,6 +65,10 @@ commas or semicolons.
|
|||||||
* VKD3D_TEST_DEBUG - enables additional debug messages in tests. Set to 0, 1
|
* VKD3D_TEST_DEBUG - enables additional debug messages in tests. Set to 0, 1
|
||||||
or 2.
|
or 2.
|
||||||
|
|
||||||
|
* VKD3D_TEST_FILTER - a filter string. Only the tests whose names matches the
|
||||||
|
filter string will be run, e.g. VKD3D_TEST_FILTER=clear_render_target.
|
||||||
|
Useful for debugging or developing new tests.
|
||||||
|
|
||||||
* VKD3D_TEST_PLATFORM - can be set to "wine", "windows" or "other". The test
|
* VKD3D_TEST_PLATFORM - can be set to "wine", "windows" or "other". The test
|
||||||
platform controls the behavior of todo(), todo_if(), bug_if() and broken()
|
platform controls the behavior of todo(), todo_if(), bug_if() and broken()
|
||||||
conditions in tests.
|
conditions in tests.
|
||||||
|
@ -118,6 +118,7 @@ static struct
|
|||||||
bool bug_do_loop;
|
bool bug_do_loop;
|
||||||
bool bug_enabled;
|
bool bug_enabled;
|
||||||
|
|
||||||
|
const char *test_name_filter;
|
||||||
char context[1024];
|
char context[1024];
|
||||||
} vkd3d_test_state;
|
} vkd3d_test_state;
|
||||||
|
|
||||||
@ -254,6 +255,7 @@ vkd3d_test_debug(const char *fmt, ...)
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
const char *test_filter = getenv("VKD3D_TEST_FILTER");
|
||||||
const char *debug_level = getenv("VKD3D_TEST_DEBUG");
|
const char *debug_level = getenv("VKD3D_TEST_DEBUG");
|
||||||
char *test_platform = getenv("VKD3D_TEST_PLATFORM");
|
char *test_platform = getenv("VKD3D_TEST_PLATFORM");
|
||||||
const char *bug = getenv("VKD3D_TEST_BUG");
|
const char *bug = getenv("VKD3D_TEST_BUG");
|
||||||
@ -261,6 +263,7 @@ int main(int argc, char **argv)
|
|||||||
memset(&vkd3d_test_state, 0, sizeof(vkd3d_test_state));
|
memset(&vkd3d_test_state, 0, sizeof(vkd3d_test_state));
|
||||||
vkd3d_test_state.debug_level = debug_level ? atoi(debug_level) : 0;
|
vkd3d_test_state.debug_level = debug_level ? atoi(debug_level) : 0;
|
||||||
vkd3d_test_state.bug_enabled = bug ? atoi(bug) : true;
|
vkd3d_test_state.bug_enabled = bug ? atoi(bug) : true;
|
||||||
|
vkd3d_test_state.test_name_filter = test_filter;
|
||||||
|
|
||||||
if (test_platform)
|
if (test_platform)
|
||||||
{
|
{
|
||||||
@ -341,6 +344,9 @@ typedef void (*vkd3d_test_pfn)(void);
|
|||||||
|
|
||||||
static inline void vkd3d_run_test(const char *name, vkd3d_test_pfn test_pfn)
|
static inline void vkd3d_run_test(const char *name, vkd3d_test_pfn test_pfn)
|
||||||
{
|
{
|
||||||
|
if (vkd3d_test_state.test_name_filter && !strstr(name, vkd3d_test_state.test_name_filter))
|
||||||
|
return;
|
||||||
|
|
||||||
vkd3d_test_debug("%s", name);
|
vkd3d_test_debug("%s", name);
|
||||||
test_pfn();
|
test_pfn();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user