mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
tests: Write test name to debug output.
This is useful when inspecting the output of D3D12 debug layer.
This commit is contained in:
parent
9242c12c51
commit
2eed0e0ed3
@ -153,6 +153,30 @@ vkd3d_test_trace(unsigned int line, const char *fmt, ...)
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
static void VKD3D_PRINTF_FUNC(1, 2) VKD3D_UNUSED
|
||||
vkd3d_test_debug(const char *fmt, ...)
|
||||
{
|
||||
char buffer[512];
|
||||
va_list args;
|
||||
int size;
|
||||
|
||||
size = snprintf(buffer, sizeof(buffer), "%s: ", vkd3d_test_name);
|
||||
if (0 < size && size < sizeof(buffer))
|
||||
{
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buffer + size, sizeof(buffer) - size, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
buffer[sizeof(buffer) - 1] = '\0';
|
||||
|
||||
#ifdef _WIN32
|
||||
OutputDebugStringA(buffer);
|
||||
#endif
|
||||
|
||||
if (vkd3d_test_state.debug)
|
||||
printf("%s\n", buffer);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
int wmain(void)
|
||||
#else
|
||||
@ -181,4 +205,15 @@ int main(void)
|
||||
return vkd3d_test_state.failure_count || vkd3d_test_state.todo_success_count;
|
||||
}
|
||||
|
||||
typedef void (*vkd3d_test_pfn)(void);
|
||||
|
||||
static inline void vkd3d_run_test(const char *name, vkd3d_test_pfn test_pfn)
|
||||
{
|
||||
vkd3d_test_debug(name);
|
||||
test_pfn();
|
||||
}
|
||||
|
||||
#define run_test(test_pfn) \
|
||||
vkd3d_run_test(#test_pfn, test_pfn)
|
||||
|
||||
#endif /* __VKD3D_TEST_H */
|
||||
|
@ -3119,26 +3119,26 @@ START_TEST(d3d12)
|
||||
ID3D12Debug_Release(debug);
|
||||
}
|
||||
|
||||
test_create_device();
|
||||
test_node_count();
|
||||
test_check_feature_support();
|
||||
test_create_command_allocator();
|
||||
test_create_command_list();
|
||||
test_create_command_queue();
|
||||
test_create_committed_resource();
|
||||
test_create_descriptor_heap();
|
||||
test_create_root_signature();
|
||||
test_create_pipeline_state();
|
||||
test_create_fence();
|
||||
test_reset_command_allocator();
|
||||
test_cpu_signal_fence();
|
||||
test_gpu_signal_fence();
|
||||
test_multithread_fence_wait();
|
||||
test_clear_render_target_view();
|
||||
test_draw_instanced();
|
||||
test_texture_resource_barriers();
|
||||
test_invalid_texture_resource_barriers();
|
||||
test_device_removed_reason();
|
||||
test_map_resource();
|
||||
test_bundle_state_inheritance();
|
||||
run_test(test_create_device);
|
||||
run_test(test_node_count);
|
||||
run_test(test_check_feature_support);
|
||||
run_test(test_create_command_allocator);
|
||||
run_test(test_create_command_list);
|
||||
run_test(test_create_command_queue);
|
||||
run_test(test_create_committed_resource);
|
||||
run_test(test_create_descriptor_heap);
|
||||
run_test(test_create_root_signature);
|
||||
run_test(test_create_pipeline_state);
|
||||
run_test(test_create_fence);
|
||||
run_test(test_reset_command_allocator);
|
||||
run_test(test_cpu_signal_fence);
|
||||
run_test(test_gpu_signal_fence);
|
||||
run_test(test_multithread_fence_wait);
|
||||
run_test(test_clear_render_target_view);
|
||||
run_test(test_draw_instanced);
|
||||
run_test(test_texture_resource_barriers);
|
||||
run_test(test_invalid_texture_resource_barriers);
|
||||
run_test(test_device_removed_reason);
|
||||
run_test(test_map_resource);
|
||||
run_test(test_bundle_state_inheritance);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user