From 8d12dfc3e3f113a2e01c2709c02b8d99fb913f9e Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 24 May 2019 12:08:24 +0100 Subject: [PATCH] Avoid need to re-state test name in REGISTER_TEST() macro * At the same time while changing this we ensure all tests are prefixed. --- util/test/demos/d3d11/d3d11_1_many_uavs.cpp | 4 +- .../demos/d3d11/d3d11_array_interpolator.cpp | 4 +- .../demos/d3d11/d3d11_binding_hazards.cpp | 4 +- .../d3d11/d3d11_byte_address_buffers.cpp | 4 +- util/test/demos/d3d11/d3d11_cbuffer_zoo.cpp | 4 +- .../demos/d3d11/d3d11_counter_query_pred.cpp | 4 +- util/test/demos/d3d11/d3d11_debug_shader.cpp | 4 +- .../d3d11_deferred_updatesubresource.cpp | 4 +- util/test/demos/d3d11/d3d11_discard_view.cpp | 4 +- .../demos/d3d11/d3d11_divergent_shader.cpp | 4 +- util/test/demos/d3d11/d3d11_draw_zoo.cpp | 4 +- .../d3d11/d3d11_empty_compute_dispatch.cpp | 4 +- .../test/demos/d3d11/d3d11_empty_drawcall.cpp | 4 +- .../demos/d3d11/d3d11_empty_viewports.cpp | 4 +- util/test/demos/d3d11/d3d11_many_rtvs.cpp | 4 +- util/test/demos/d3d11/d3d11_map_overrun.cpp | 4 +- .../demos/d3d11/d3d11_midframe_create.cpp | 4 +- util/test/demos/d3d11/d3d11_mip_gen_rt.cpp | 4 +- util/test/demos/d3d11/d3d11_mip_rtv.cpp | 4 +- .../demos/d3d11/d3d11_overdraw_stress.cpp | 4 +- util/test/demos/d3d11/d3d11_overlay_test.cpp | 4 +- .../demos/d3d11/d3d11_primitive_restart.cpp | 4 +- .../test/demos/d3d11/d3d11_refcount_check.cpp | 4 +- .../demos/d3d11/d3d11_resource_lifetimes.cpp | 4 +- util/test/demos/d3d11/d3d11_saturate.cpp | 4 +- .../demos/d3d11/d3d11_simple_dispatch.cpp | 4 +- .../demos/d3d11/d3d11_simple_triangle.cpp | 4 +- util/test/demos/d3d11/d3d11_streamout.cpp | 4 +- .../demos/d3d11/d3d11_stripped_shaders.cpp | 4 +- ...d11_structured_buffer_misaligned_dirty.cpp | 4 +- .../d3d11/d3d11_structured_buffer_nested.cpp | 4 +- .../d3d11/d3d11_structured_buffer_read.cpp | 4 +- util/test/demos/d3d11/d3d11_texture_3d.cpp | 4 +- .../test/demos/d3d11/d3d11_video_textures.cpp | 4 +- util/test/demos/d3d12/d3d12_cbuffer_zoo.cpp | 4 +- util/test/demos/d3d12/d3d12_overlay_test.cpp | 4 +- .../demos/d3d12/d3d12_resource_lifetimes.cpp | 4 +- .../demos/d3d12/d3d12_simple_triangle.cpp | 4 +- .../test/demos/d3d12/d3d12_video_textures.cpp | 4 +- util/test/demos/gl/gl_buffer_updates.cpp | 4 +- util/test/demos/gl/gl_cbuffer_zoo.cpp | 4 +- util/test/demos/gl/gl_depthstencil_fbo.cpp | 4 +- util/test/demos/gl/gl_dx_interop.cpp | 4 +- util/test/demos/gl/gl_entry_points.cpp | 4 +- util/test/demos/gl/gl_large_bcn_arrays.cpp | 4 +- util/test/demos/gl/gl_map_overrun.cpp | 4 +- .../demos/gl/gl_midframe_context_create.cpp | 4 +- util/test/demos/gl/gl_mip_gen_rt.cpp | 4 +- util/test/demos/gl/gl_multi_window.cpp | 4 +- util/test/demos/gl/gl_overlay_test.cpp | 4 +- util/test/demos/gl/gl_resource_lifetimes.cpp | 4 +- .../demos/gl/gl_runtime_bind_prog_to_pipe.cpp | 4 +- .../demos/gl/gl_separable_geometry_shader.cpp | 4 +- util/test/demos/gl/gl_simple_triangle.cpp | 4 +- util/test/demos/gl/gl_spirv_shader.cpp | 4 +- .../demos/gl/gl_structured_buffer_nested.cpp | 4 +- .../demos/gl/gl_unsized_ms_fbo_attachment.cpp | 4 +- util/test/demos/gl/gl_vao_0.cpp | 4 +- util/test/demos/main.cpp | 9 +-- util/test/demos/test_common.h | 80 +++++++++---------- util/test/demos/vk/vk_adv_cbuffer_zoo.cpp | 4 +- util/test/demos/vk/vk_awkward_triangle.cpp | 4 +- util/test/demos/vk/vk_buffer_address.cpp | 4 +- util/test/demos/vk/vk_cbuffer_zoo.cpp | 4 +- util/test/demos/vk/vk_descriptor_index.cpp | 4 +- util/test/demos/vk/vk_discard_rects.cpp | 4 +- util/test/demos/vk/vk_draw_zoo.cpp | 4 +- util/test/demos/vk/vk_indirect.cpp | 4 +- util/test/demos/vk/vk_overlay_test.cpp | 4 +- util/test/demos/vk/vk_resource_lifetimes.cpp | 4 +- util/test/demos/vk/vk_sample_locations.cpp | 4 +- util/test/demos/vk/vk_secondary_cmdbuf.cpp | 4 +- util/test/demos/vk/vk_simple_triangle.cpp | 4 +- .../demos/vk/vk_structured_buffer_nested.cpp | 4 +- util/test/demos/vk/vk_video_textures.cpp | 4 +- util/test/demos/vk/vk_vs_max_desc_set.cpp | 4 +- 76 files changed, 192 insertions(+), 193 deletions(-) diff --git a/util/test/demos/d3d11/d3d11_1_many_uavs.cpp b/util/test/demos/d3d11/d3d11_1_many_uavs.cpp index 3d49399d9..fdaa32086 100644 --- a/util/test/demos/d3d11/d3d11_1_many_uavs.cpp +++ b/util/test/demos/d3d11/d3d11_1_many_uavs.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Many_UAVs : D3D11GraphicsTest +TEST(D3D11_Many_UAVs, D3D11GraphicsTest) { static constexpr const char *Description = "Test using more than 8 compute shader UAVs (D3D11.1 feature)"; @@ -79,4 +79,4 @@ void main() } }; -REGISTER_TEST(Many_UAVs); \ No newline at end of file +REGISTER_TEST(); \ No newline at end of file diff --git a/util/test/demos/d3d11/d3d11_array_interpolator.cpp b/util/test/demos/d3d11/d3d11_array_interpolator.cpp index 9dc0925b8..72a2c2920 100644 --- a/util/test/demos/d3d11/d3d11_array_interpolator.cpp +++ b/util/test/demos/d3d11/d3d11_array_interpolator.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Array_Interpolator : D3D11GraphicsTest +TEST(D3D11_Array_Interpolator, D3D11GraphicsTest) { static constexpr const char *Description = "Test passing an array of float2 to make sure the interpolator packing is handled by " @@ -115,4 +115,4 @@ float4 main(v2f IN) : SV_Target0 } }; -REGISTER_TEST(Array_Interpolator); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_binding_hazards.cpp b/util/test/demos/d3d11/d3d11_binding_hazards.cpp index 10338888c..aefa7e8dd 100644 --- a/util/test/demos/d3d11/d3d11_binding_hazards.cpp +++ b/util/test/demos/d3d11/d3d11_binding_hazards.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Binding_Hazards : D3D11GraphicsTest +TEST(D3D11_Binding_Hazards, D3D11GraphicsTest) { static constexpr const char *Description = "Test of D3D11 hazard tracking write/read bindings"; @@ -242,4 +242,4 @@ void main() } }; -REGISTER_TEST(Binding_Hazards); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_byte_address_buffers.cpp b/util/test/demos/d3d11/d3d11_byte_address_buffers.cpp index ef790a0ac..27bdd89a5 100644 --- a/util/test/demos/d3d11/d3d11_byte_address_buffers.cpp +++ b/util/test/demos/d3d11/d3d11_byte_address_buffers.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Byte_Address_Buffers : D3D11GraphicsTest +TEST(D3D11_Byte_Address_Buffers, D3D11GraphicsTest) { static constexpr const char *Description = "Tests reading and writing from byte address buffers"; @@ -83,4 +83,4 @@ void main() } }; -REGISTER_TEST(Byte_Address_Buffers); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_cbuffer_zoo.cpp b/util/test/demos/d3d11/d3d11_cbuffer_zoo.cpp index bd86c7948..2437a82b3 100644 --- a/util/test/demos/d3d11/d3d11_cbuffer_zoo.cpp +++ b/util/test/demos/d3d11/d3d11_cbuffer_zoo.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct D3D11_CBuffer_Zoo : D3D11GraphicsTest +TEST(D3D11_CBuffer_Zoo, D3D11GraphicsTest) { static constexpr const char *Description = "Tests every kind of constant that can be in a cbuffer to make sure it's decoded " @@ -288,4 +288,4 @@ float4 main() : SV_Target0 } }; -REGISTER_TEST(D3D11_CBuffer_Zoo); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_counter_query_pred.cpp b/util/test/demos/d3d11/d3d11_counter_query_pred.cpp index 847c8794c..d2a173f60 100644 --- a/util/test/demos/d3d11/d3d11_counter_query_pred.cpp +++ b/util/test/demos/d3d11/d3d11_counter_query_pred.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Counter_Query_Pred : D3D11GraphicsTest +TEST(D3D11_Counter_Query_Pred, D3D11GraphicsTest) { static constexpr const char *Description = "Tests use of D3D11 counters, queries and predication. " @@ -286,4 +286,4 @@ struct Counter_Query_Pred : D3D11GraphicsTest } }; -REGISTER_TEST(Counter_Query_Pred); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_debug_shader.cpp b/util/test/demos/d3d11/d3d11_debug_shader.cpp index dc6c8c1b7..8010ff5ce 100644 --- a/util/test/demos/d3d11/d3d11_debug_shader.cpp +++ b/util/test/demos/d3d11/d3d11_debug_shader.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Debug_Shader : D3D11GraphicsTest +TEST(D3D11_Debug_Shader, D3D11GraphicsTest) { static constexpr const char *Description = "Tests simple shader debugging identities by rendering many small triangles and " @@ -284,4 +284,4 @@ float4 main(v2f IN) : SV_Target0 } }; -REGISTER_TEST(Debug_Shader); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_deferred_updatesubresource.cpp b/util/test/demos/d3d11/d3d11_deferred_updatesubresource.cpp index 2cb43093b..3dfac6db7 100644 --- a/util/test/demos/d3d11/d3d11_deferred_updatesubresource.cpp +++ b/util/test/demos/d3d11/d3d11_deferred_updatesubresource.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Deferred_UpdateSubresource : D3D11GraphicsTest +TEST(D3D11_Deferred_UpdateSubresource, D3D11GraphicsTest) { static constexpr const char *Description = "Test that does UpdateSubresource on a deferred context which might need some " @@ -233,4 +233,4 @@ float4 main(v2f IN) : SV_Target0 } }; -REGISTER_TEST(Deferred_UpdateSubresource); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_discard_view.cpp b/util/test/demos/d3d11/d3d11_discard_view.cpp index e5cee3f1c..568e87ecc 100644 --- a/util/test/demos/d3d11/d3d11_discard_view.cpp +++ b/util/test/demos/d3d11/d3d11_discard_view.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Discard_View : D3D11GraphicsTest +TEST(D3D11_Discard_View, D3D11GraphicsTest) { static constexpr const char *Description = "Test that discards an RTV"; @@ -131,4 +131,4 @@ float4 main() : SV_Target0 } }; -REGISTER_TEST(Discard_View); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_divergent_shader.cpp b/util/test/demos/d3d11/d3d11_divergent_shader.cpp index 1eb9fe131..7817ce354 100644 --- a/util/test/demos/d3d11/d3d11_divergent_shader.cpp +++ b/util/test/demos/d3d11/d3d11_divergent_shader.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Divergent_Shader : D3D11GraphicsTest +TEST(D3D11_Divergent_Shader, D3D11GraphicsTest) { static constexpr const char *Description = "Test running a shader that diverges across a quad and then expects derivatives to " @@ -165,4 +165,4 @@ float4 main(v2f IN) : SV_Target0 } }; -REGISTER_TEST(Divergent_Shader); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_draw_zoo.cpp b/util/test/demos/d3d11/d3d11_draw_zoo.cpp index 257f25e47..cf4915460 100644 --- a/util/test/demos/d3d11/d3d11_draw_zoo.cpp +++ b/util/test/demos/d3d11/d3d11_draw_zoo.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct D3D11_Draw_Zoo : D3D11GraphicsTest +TEST(D3D11_Draw_Zoo, D3D11GraphicsTest) { static constexpr const char *Description = "Draws several variants using different vertex/index offsets."; @@ -399,4 +399,4 @@ float4 main(v2f IN) : SV_Target0 } }; -REGISTER_TEST(D3D11_Draw_Zoo); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_empty_compute_dispatch.cpp b/util/test/demos/d3d11/d3d11_empty_compute_dispatch.cpp index 201eab128..90c360a76 100644 --- a/util/test/demos/d3d11/d3d11_empty_compute_dispatch.cpp +++ b/util/test/demos/d3d11/d3d11_empty_compute_dispatch.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Empty_Compute_Dispatch : D3D11GraphicsTest +TEST(D3D11_Empty_Compute_Dispatch, D3D11GraphicsTest) { static constexpr const char *Description = "Test dispatching with one threadgroup count set to 0"; @@ -77,4 +77,4 @@ void main() } }; -REGISTER_TEST(Empty_Compute_Dispatch); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_empty_drawcall.cpp b/util/test/demos/d3d11/d3d11_empty_drawcall.cpp index 0c9fe84b2..8d24e387e 100644 --- a/util/test/demos/d3d11/d3d11_empty_drawcall.cpp +++ b/util/test/demos/d3d11/d3d11_empty_drawcall.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Empty_Drawcall : D3D11GraphicsTest +TEST(D3D11_Empty_Drawcall, D3D11GraphicsTest) { static constexpr const char *Description = "Test a drawcall of 0 size"; @@ -68,4 +68,4 @@ struct Empty_Drawcall : D3D11GraphicsTest } }; -REGISTER_TEST(Empty_Drawcall); \ No newline at end of file +REGISTER_TEST(); \ No newline at end of file diff --git a/util/test/demos/d3d11/d3d11_empty_viewports.cpp b/util/test/demos/d3d11/d3d11_empty_viewports.cpp index 2596b9cdd..b18236ddd 100644 --- a/util/test/demos/d3d11/d3d11_empty_viewports.cpp +++ b/util/test/demos/d3d11/d3d11_empty_viewports.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Empty_Viewports : D3D11GraphicsTest +TEST(D3D11_Empty_Viewports, D3D11GraphicsTest) { static constexpr const char *Description = "Test setting some viewports that are empty, but enabled"; @@ -74,4 +74,4 @@ struct Empty_Viewports : D3D11GraphicsTest } }; -REGISTER_TEST(Empty_Viewports); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_many_rtvs.cpp b/util/test/demos/d3d11/d3d11_many_rtvs.cpp index eb9120727..22bf178b1 100644 --- a/util/test/demos/d3d11/d3d11_many_rtvs.cpp +++ b/util/test/demos/d3d11/d3d11_many_rtvs.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Many_RTVs : D3D11GraphicsTest +TEST(D3D11_Many_RTVs, D3D11GraphicsTest) { static constexpr const char *Description = "Test repeatedly creating and destroying RTVs"; @@ -103,4 +103,4 @@ float4 main() : SV_Target0 } }; -REGISTER_TEST(Many_RTVs); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_map_overrun.cpp b/util/test/demos/d3d11/d3d11_map_overrun.cpp index 0079a042d..bde987321 100644 --- a/util/test/demos/d3d11/d3d11_map_overrun.cpp +++ b/util/test/demos/d3d11/d3d11_map_overrun.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct D3D11_Map_Overrun : D3D11GraphicsTest +TEST(D3D11_Map_Overrun, D3D11GraphicsTest) { static constexpr const char *Description = "Test overrunning the bounds of a Map() call"; @@ -117,4 +117,4 @@ float4 main(v2f IN) : SV_Target0 } }; -REGISTER_TEST(D3D11_Map_Overrun); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_midframe_create.cpp b/util/test/demos/d3d11/d3d11_midframe_create.cpp index 50559879a..1430d1147 100644 --- a/util/test/demos/d3d11/d3d11_midframe_create.cpp +++ b/util/test/demos/d3d11/d3d11_midframe_create.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct D3D11_Midframe_Create : D3D11GraphicsTest +TEST(D3D11_Midframe_Create, D3D11GraphicsTest) { static constexpr const char *Description = "Tests creating resources mid-frame to make sure that they and their contents are " @@ -270,4 +270,4 @@ float4 main(v2f IN) : SV_Target0 } }; -REGISTER_TEST(D3D11_Midframe_Create); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_mip_gen_rt.cpp b/util/test/demos/d3d11/d3d11_mip_gen_rt.cpp index 60dd8afd8..744d0af59 100644 --- a/util/test/demos/d3d11/d3d11_mip_gen_rt.cpp +++ b/util/test/demos/d3d11/d3d11_mip_gen_rt.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct D3D11_Mip_Gen_RT : D3D11GraphicsTest +TEST(D3D11_Mip_Gen_RT, D3D11GraphicsTest) { static constexpr const char *Description = "Tests rendering from one mip to another to do a downsample chain"; @@ -155,4 +155,4 @@ float4 main(v2f IN) : SV_Target0 } }; -REGISTER_TEST(D3D11_Mip_Gen_RT); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_mip_rtv.cpp b/util/test/demos/d3d11/d3d11_mip_rtv.cpp index 437555de2..96f0268f5 100644 --- a/util/test/demos/d3d11/d3d11_mip_rtv.cpp +++ b/util/test/demos/d3d11/d3d11_mip_rtv.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Mip_RTV : D3D11GraphicsTest +TEST(D3D11_Mip_RTV, D3D11GraphicsTest) { static constexpr const char *Description = "Test rendering into RTV mip levels"; @@ -117,4 +117,4 @@ float4 main() : SV_Target0 } }; -REGISTER_TEST(Mip_RTV); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_overdraw_stress.cpp b/util/test/demos/d3d11/d3d11_overdraw_stress.cpp index 40bcfc7a0..810959e58 100644 --- a/util/test/demos/d3d11/d3d11_overdraw_stress.cpp +++ b/util/test/demos/d3d11/d3d11_overdraw_stress.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Overdraw_Stress : D3D11GraphicsTest +TEST(D3D11_Overdraw_Stress, D3D11GraphicsTest) { static constexpr const char *Description = "Renders a lot of overlapping triangles"; @@ -123,4 +123,4 @@ struct Overdraw_Stress : D3D11GraphicsTest } }; -REGISTER_TEST(Overdraw_Stress); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_overlay_test.cpp b/util/test/demos/d3d11/d3d11_overlay_test.cpp index 3858e766f..416fc4190 100644 --- a/util/test/demos/d3d11/d3d11_overlay_test.cpp +++ b/util/test/demos/d3d11/d3d11_overlay_test.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct D3D11_Overlay_Test : D3D11GraphicsTest +TEST(D3D11_Overlay_Test, D3D11GraphicsTest) { static constexpr const char *Description = "Makes a couple of draws that show off all the overlays in some way"; @@ -167,4 +167,4 @@ struct D3D11_Overlay_Test : D3D11GraphicsTest } }; -REGISTER_TEST(D3D11_Overlay_Test); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_primitive_restart.cpp b/util/test/demos/d3d11/d3d11_primitive_restart.cpp index 2ce034fe0..238c99ddd 100644 --- a/util/test/demos/d3d11/d3d11_primitive_restart.cpp +++ b/util/test/demos/d3d11/d3d11_primitive_restart.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct D3D11_Primitive_Restart : D3D11GraphicsTest +TEST(D3D11_Primitive_Restart, D3D11GraphicsTest) { static constexpr const char *Description = "Test of primitive restart in triangle strips with -1 index"; @@ -123,4 +123,4 @@ struct D3D11_Primitive_Restart : D3D11GraphicsTest } }; -REGISTER_TEST(D3D11_Primitive_Restart); \ No newline at end of file +REGISTER_TEST(); \ No newline at end of file diff --git a/util/test/demos/d3d11/d3d11_refcount_check.cpp b/util/test/demos/d3d11/d3d11_refcount_check.cpp index 852f94e74..c3e038dfd 100644 --- a/util/test/demos/d3d11/d3d11_refcount_check.cpp +++ b/util/test/demos/d3d11/d3d11_refcount_check.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Refcount_Check : D3D11GraphicsTest +TEST(D3D11_Refcount_Check, D3D11GraphicsTest) { static constexpr const char *Description = "Ensures that the device etc doesn't delete itself when there are still outstanding " @@ -123,4 +123,4 @@ struct Refcount_Check : D3D11GraphicsTest } }; -REGISTER_TEST(Refcount_Check); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_resource_lifetimes.cpp b/util/test/demos/d3d11/d3d11_resource_lifetimes.cpp index 21cb0756f..36282d90c 100644 --- a/util/test/demos/d3d11/d3d11_resource_lifetimes.cpp +++ b/util/test/demos/d3d11/d3d11_resource_lifetimes.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct D3D11_Resource_Lifetimes : D3D11GraphicsTest +TEST(D3D11_Resource_Lifetimes, D3D11GraphicsTest) { static constexpr const char *Description = "Test various edge-case resource lifetimes: a resource that is first dirtied within a frame " @@ -192,4 +192,4 @@ float4 main(v2f IN) : SV_Target0 } }; -REGISTER_TEST(D3D11_Resource_Lifetimes); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_saturate.cpp b/util/test/demos/d3d11/d3d11_saturate.cpp index bdf243790..53141dad6 100644 --- a/util/test/demos/d3d11/d3d11_saturate.cpp +++ b/util/test/demos/d3d11/d3d11_saturate.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Saturate : D3D11GraphicsTest +TEST(D3D11_Saturate, D3D11GraphicsTest) { static constexpr const char *Description = "Tests using saturate, originally for a bug report"; @@ -104,4 +104,4 @@ void main(float4 pos : SV_Position, out float4 a : SV_Target0, out float4 b : SV } }; -REGISTER_TEST(Saturate); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_simple_dispatch.cpp b/util/test/demos/d3d11/d3d11_simple_dispatch.cpp index 33b94dab7..54d883310 100644 --- a/util/test/demos/d3d11/d3d11_simple_dispatch.cpp +++ b/util/test/demos/d3d11/d3d11_simple_dispatch.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Simple_Dispatch : D3D11GraphicsTest +TEST(D3D11_Simple_Dispatch, D3D11GraphicsTest) { static constexpr const char *Description = "Test that just does a dispatch and some copies, for checking basic compute stuff"; @@ -98,4 +98,4 @@ void main() } }; -REGISTER_TEST(Simple_Dispatch); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_simple_triangle.cpp b/util/test/demos/d3d11/d3d11_simple_triangle.cpp index bd4e75430..6d2706f4a 100644 --- a/util/test/demos/d3d11/d3d11_simple_triangle.cpp +++ b/util/test/demos/d3d11/d3d11_simple_triangle.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct D3D11_Simple_Triangle : D3D11GraphicsTest +TEST(D3D11_Simple_Triangle, D3D11GraphicsTest) { static constexpr const char *Description = "Just draws a simple triangle, using normal pipeline. Basic test that can be used " @@ -70,4 +70,4 @@ struct D3D11_Simple_Triangle : D3D11GraphicsTest } }; -REGISTER_TEST(D3D11_Simple_Triangle); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_streamout.cpp b/util/test/demos/d3d11/d3d11_streamout.cpp index 8077e0648..a35dfd101 100644 --- a/util/test/demos/d3d11/d3d11_streamout.cpp +++ b/util/test/demos/d3d11/d3d11_streamout.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct StreamOut : D3D11GraphicsTest +TEST(D3D11_StreamOut, D3D11GraphicsTest) { static constexpr const char *Description = "Test using D3D11's streamout feature"; @@ -131,4 +131,4 @@ struct StreamOut : D3D11GraphicsTest } }; -REGISTER_TEST(StreamOut); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_stripped_shaders.cpp b/util/test/demos/d3d11/d3d11_stripped_shaders.cpp index 27d8ff8e4..a9f45c715 100644 --- a/util/test/demos/d3d11/d3d11_stripped_shaders.cpp +++ b/util/test/demos/d3d11/d3d11_stripped_shaders.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Stripped_Shaders : D3D11GraphicsTest +TEST(D3D11_Stripped_Shaders, D3D11GraphicsTest) { static constexpr const char *Description = "Tests shaders with their debug/reflection info stripped out and stored in separate blobs"; @@ -79,4 +79,4 @@ struct Stripped_Shaders : D3D11GraphicsTest } }; -REGISTER_TEST(Stripped_Shaders); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_structured_buffer_misaligned_dirty.cpp b/util/test/demos/d3d11/d3d11_structured_buffer_misaligned_dirty.cpp index 24e2c9ddd..dc0436b65 100644 --- a/util/test/demos/d3d11/d3d11_structured_buffer_misaligned_dirty.cpp +++ b/util/test/demos/d3d11/d3d11_structured_buffer_misaligned_dirty.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Structured_Buffer_MisalignedDirty : D3D11GraphicsTest +TEST(D3D11_Structured_Buffer_MisalignedDirty, D3D11GraphicsTest) { static constexpr const char *Description = "Test updating a misaligned chunk of a structured buffer"; @@ -141,4 +141,4 @@ float4 main() : SV_Target0 } }; -REGISTER_TEST(Structured_Buffer_MisalignedDirty); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_structured_buffer_nested.cpp b/util/test/demos/d3d11/d3d11_structured_buffer_nested.cpp index ff14b11a4..0f378c675 100644 --- a/util/test/demos/d3d11/d3d11_structured_buffer_nested.cpp +++ b/util/test/demos/d3d11/d3d11_structured_buffer_nested.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct D3D11_Structured_Buffer_Nested : D3D11GraphicsTest +TEST(D3D11_Structured_Buffer_Nested, D3D11GraphicsTest) { static constexpr const char *Description = "Test reading from structured buffers with nested structs"; @@ -137,4 +137,4 @@ float4 main() : SV_Target0 } }; -REGISTER_TEST(D3D11_Structured_Buffer_Nested); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_structured_buffer_read.cpp b/util/test/demos/d3d11/d3d11_structured_buffer_read.cpp index a14e5b225..339a897b1 100644 --- a/util/test/demos/d3d11/d3d11_structured_buffer_read.cpp +++ b/util/test/demos/d3d11/d3d11_structured_buffer_read.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Structured_Buffer_Read : D3D11GraphicsTest +TEST(D3D11_Structured_Buffer_Read, D3D11GraphicsTest) { static constexpr const char *Description = "Test reading from structured buffers, with and without offsets"; @@ -103,4 +103,4 @@ float4 main() : SV_Target0 } }; -REGISTER_TEST(Structured_Buffer_Read); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_texture_3d.cpp b/util/test/demos/d3d11/d3d11_texture_3d.cpp index bd09735ff..a6848e6b2 100644 --- a/util/test/demos/d3d11/d3d11_texture_3d.cpp +++ b/util/test/demos/d3d11/d3d11_texture_3d.cpp @@ -24,7 +24,7 @@ #include "d3d11_test.h" -struct Texture_3D : D3D11GraphicsTest +TEST(D3D11_Texture_3D, D3D11GraphicsTest) { static constexpr const char *Description = "Test that creates and samples a 3D texture"; @@ -266,4 +266,4 @@ float4 main(v2f IN) : SV_Target0 } }; -REGISTER_TEST(Texture_3D); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d11/d3d11_video_textures.cpp b/util/test/demos/d3d11/d3d11_video_textures.cpp index a700f5af8..bf2d7e602 100644 --- a/util/test/demos/d3d11/d3d11_video_textures.cpp +++ b/util/test/demos/d3d11/d3d11_video_textures.cpp @@ -52,7 +52,7 @@ COM_SMARTPTR(IMFByteStream); /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// -struct D3D11_Video_Textures : D3D11GraphicsTest, IMFMediaEngineNotify +TEST(D3D11_Video_Textures, D3D11GraphicsTest), IMFMediaEngineNotify { static constexpr const char *Description = "Tests of YUV textures"; @@ -846,4 +846,4 @@ float4 main(v2f IN) : SV_Target0 } }; -REGISTER_TEST(D3D11_Video_Textures); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d12/d3d12_cbuffer_zoo.cpp b/util/test/demos/d3d12/d3d12_cbuffer_zoo.cpp index 80fe4c68f..73500ed13 100644 --- a/util/test/demos/d3d12/d3d12_cbuffer_zoo.cpp +++ b/util/test/demos/d3d12/d3d12_cbuffer_zoo.cpp @@ -24,7 +24,7 @@ #include "d3d12_test.h" -struct D3D12_CBuffer_Zoo : D3D12GraphicsTest +TEST(D3D12_CBuffer_Zoo, D3D12GraphicsTest) { static constexpr const char *Description = "Tests every kind of constant that can be in a cbuffer to make sure it's decoded " @@ -356,4 +356,4 @@ float4 main() : SV_Target0 } }; -REGISTER_TEST(D3D12_CBuffer_Zoo); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d12/d3d12_overlay_test.cpp b/util/test/demos/d3d12/d3d12_overlay_test.cpp index cd7e722e7..098398f6b 100644 --- a/util/test/demos/d3d12/d3d12_overlay_test.cpp +++ b/util/test/demos/d3d12/d3d12_overlay_test.cpp @@ -24,7 +24,7 @@ #include "d3d12_test.h" -struct D3D12_Overlay_Test : D3D12GraphicsTest +TEST(D3D12_Overlay_Test, D3D12GraphicsTest) { static constexpr const char *Description = "Makes a couple of draws that show off all the overlays in some way"; @@ -195,4 +195,4 @@ struct D3D12_Overlay_Test : D3D12GraphicsTest } }; -REGISTER_TEST(D3D12_Overlay_Test); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d12/d3d12_resource_lifetimes.cpp b/util/test/demos/d3d12/d3d12_resource_lifetimes.cpp index 39b08895d..1e81160db 100644 --- a/util/test/demos/d3d12/d3d12_resource_lifetimes.cpp +++ b/util/test/demos/d3d12/d3d12_resource_lifetimes.cpp @@ -24,7 +24,7 @@ #include "d3d12_test.h" -struct D3D12_Resource_Lifetimes : D3D12GraphicsTest +TEST(D3D12_Resource_Lifetimes, D3D12GraphicsTest) { static constexpr const char *Description = "Test various edge-case resource lifetimes: a resource that is first dirtied within a frame " @@ -528,4 +528,4 @@ float4 main(v2f IN) : SV_Target0 } }; -REGISTER_TEST(D3D12_Resource_Lifetimes); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d12/d3d12_simple_triangle.cpp b/util/test/demos/d3d12/d3d12_simple_triangle.cpp index 030ad0dd6..dd2f30928 100644 --- a/util/test/demos/d3d12/d3d12_simple_triangle.cpp +++ b/util/test/demos/d3d12/d3d12_simple_triangle.cpp @@ -24,7 +24,7 @@ #include "d3d12_test.h" -struct D3D12_Simple_Triangle : D3D12GraphicsTest +TEST(D3D12_Simple_Triangle, D3D12GraphicsTest) { static constexpr const char *Description = "Just draws a simple triangle, using normal pipeline. Basic test that can be used " @@ -86,4 +86,4 @@ struct D3D12_Simple_Triangle : D3D12GraphicsTest } }; -REGISTER_TEST(D3D12_Simple_Triangle); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/d3d12/d3d12_video_textures.cpp b/util/test/demos/d3d12/d3d12_video_textures.cpp index 42ac4c796..be9a100ac 100644 --- a/util/test/demos/d3d12/d3d12_video_textures.cpp +++ b/util/test/demos/d3d12/d3d12_video_textures.cpp @@ -37,7 +37,7 @@ /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// -struct D3D12_Video_Textures : D3D12GraphicsTest +TEST(D3D12_Video_Textures, D3D12GraphicsTest) { static constexpr const char *Description = "Tests of YUV textures"; @@ -700,4 +700,4 @@ float4 main(v2f IN) : SV_Target0 } }; -REGISTER_TEST(D3D12_Video_Textures); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_buffer_updates.cpp b/util/test/demos/gl/gl_buffer_updates.cpp index 9315a9ed8..c2452488d 100644 --- a/util/test/demos/gl/gl_buffer_updates.cpp +++ b/util/test/demos/gl/gl_buffer_updates.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct GL_Buffer_Updates : OpenGLGraphicsTest +TEST(GL_Buffer_Updates, OpenGLGraphicsTest) { static constexpr const char *Description = "Test of buffer updates, both buffers that are updated regularly and get marked as " @@ -520,4 +520,4 @@ void main() } }; -REGISTER_TEST(GL_Buffer_Updates); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_cbuffer_zoo.cpp b/util/test/demos/gl/gl_cbuffer_zoo.cpp index 2d8b7144d..890fd74af 100644 --- a/util/test/demos/gl/gl_cbuffer_zoo.cpp +++ b/util/test/demos/gl/gl_cbuffer_zoo.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct GL_CBuffer_Zoo : OpenGLGraphicsTest +TEST(GL_CBuffer_Zoo, OpenGLGraphicsTest) { static constexpr const char *Description = "Tests every kind of constant that can be in a cbuffer to make sure it's decoded " @@ -561,4 +561,4 @@ void main() } }; -REGISTER_TEST(GL_CBuffer_Zoo); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_depthstencil_fbo.cpp b/util/test/demos/gl/gl_depthstencil_fbo.cpp index e578aedb0..c7858b949 100644 --- a/util/test/demos/gl/gl_depthstencil_fbo.cpp +++ b/util/test/demos/gl/gl_depthstencil_fbo.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct DepthStencil_FBO : OpenGLGraphicsTest +TEST(GL_DepthStencil_FBO, OpenGLGraphicsTest) { static constexpr const char *Description = "Creates a depth-stencil FBO and writes both depth and stencil to it"; @@ -196,4 +196,4 @@ void main() } }; -REGISTER_TEST(DepthStencil_FBO); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_dx_interop.cpp b/util/test/demos/gl/gl_dx_interop.cpp index b15fee53b..f7d61a09f 100644 --- a/util/test/demos/gl/gl_dx_interop.cpp +++ b/util/test/demos/gl/gl_dx_interop.cpp @@ -29,7 +29,7 @@ #include "3rdparty/glad/glad_wgl.h" -struct GL_DX_Interop : OpenGLGraphicsTest +TEST(GL_DX_Interop, OpenGLGraphicsTest) { static constexpr const char *Description = "Test interop between GL and DX (Create and render to a DX surface and include into " @@ -321,6 +321,6 @@ void main() } }; -REGISTER_TEST(GL_DX_Interop); +REGISTER_TEST(); #endif \ No newline at end of file diff --git a/util/test/demos/gl/gl_entry_points.cpp b/util/test/demos/gl/gl_entry_points.cpp index c7460f519..dbe358209 100644 --- a/util/test/demos/gl/gl_entry_points.cpp +++ b/util/test/demos/gl/gl_entry_points.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct GL_Entry_Points : OpenGLGraphicsTest +TEST(GL_Entry_Points, OpenGLGraphicsTest) { static constexpr const char *Description = "Test that RenderDoc correctly lists the different function call aliases used."; @@ -112,4 +112,4 @@ void main() } }; -REGISTER_TEST(GL_Entry_Points); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_large_bcn_arrays.cpp b/util/test/demos/gl/gl_large_bcn_arrays.cpp index 3a3e30c0b..781fe611a 100644 --- a/util/test/demos/gl/gl_large_bcn_arrays.cpp +++ b/util/test/demos/gl/gl_large_bcn_arrays.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct Large_BCn_Arrays : OpenGLGraphicsTest +TEST(GL_Large_BCn_Arrays, OpenGLGraphicsTest) { static constexpr const char *Description = "Test creating large texture 2D arrays of BC4, BC5, BC6, BC7 textures"; @@ -185,4 +185,4 @@ void main() } }; -REGISTER_TEST(Large_BCn_Arrays); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_map_overrun.cpp b/util/test/demos/gl/gl_map_overrun.cpp index e70499d96..31d8fc353 100644 --- a/util/test/demos/gl/gl_map_overrun.cpp +++ b/util/test/demos/gl/gl_map_overrun.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct GL_Map_Overrun : OpenGLGraphicsTest +TEST(GL_Map_Overrun, OpenGLGraphicsTest) { static constexpr const char *Description = "Test overrunning the bounds of a Map() call"; @@ -123,4 +123,4 @@ void main() } }; -REGISTER_TEST(GL_Map_Overrun); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_midframe_context_create.cpp b/util/test/demos/gl/gl_midframe_context_create.cpp index 8b22e3396..b0ee2a857 100644 --- a/util/test/demos/gl/gl_midframe_context_create.cpp +++ b/util/test/demos/gl/gl_midframe_context_create.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct Midframe_Context_Create : OpenGLGraphicsTest +TEST(GL_Midframe_Context_Create, OpenGLGraphicsTest) { static constexpr const char *Description = "Creates a context and activates it in the middle of rendering."; @@ -141,4 +141,4 @@ void main() } }; -REGISTER_TEST(Midframe_Context_Create); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_mip_gen_rt.cpp b/util/test/demos/gl/gl_mip_gen_rt.cpp index 347b5a836..10aad5375 100644 --- a/util/test/demos/gl/gl_mip_gen_rt.cpp +++ b/util/test/demos/gl/gl_mip_gen_rt.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct GL_Mip_Gen_RT : OpenGLGraphicsTest +TEST(GL_Mip_Gen_RT, OpenGLGraphicsTest) { static constexpr const char *Description = "Tests rendering from one mip to another to do a downsample chain"; @@ -166,4 +166,4 @@ void main() } }; -REGISTER_TEST(GL_Mip_Gen_RT); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_multi_window.cpp b/util/test/demos/gl/gl_multi_window.cpp index 2e5a5692c..9c0bbadff 100644 --- a/util/test/demos/gl/gl_multi_window.cpp +++ b/util/test/demos/gl/gl_multi_window.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct Multi_Window : OpenGLGraphicsTest +TEST(GL_Multi_Window, OpenGLGraphicsTest) { static constexpr const char *Description = "Render to two different windows to test out different contexts and window resolutions."; @@ -165,4 +165,4 @@ void main() } }; -REGISTER_TEST(Multi_Window); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_overlay_test.cpp b/util/test/demos/gl/gl_overlay_test.cpp index c5e447f34..b859a7134 100644 --- a/util/test/demos/gl/gl_overlay_test.cpp +++ b/util/test/demos/gl/gl_overlay_test.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct GL_Overlay_Test : OpenGLGraphicsTest +TEST(GL_Overlay_Test, OpenGLGraphicsTest) { static constexpr const char *Description = "Makes a couple of draws that show off all the overlays in some way"; @@ -230,4 +230,4 @@ void main() } }; -REGISTER_TEST(GL_Overlay_Test); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_resource_lifetimes.cpp b/util/test/demos/gl/gl_resource_lifetimes.cpp index 848facb30..59f8e8aa8 100644 --- a/util/test/demos/gl/gl_resource_lifetimes.cpp +++ b/util/test/demos/gl/gl_resource_lifetimes.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct GL_Resource_Lifetimes : OpenGLGraphicsTest +TEST(GL_Resource_Lifetimes, OpenGLGraphicsTest) { static constexpr const char *Description = "Test various edge-case resource lifetimes: a resource that is first dirtied within a frame " @@ -413,4 +413,4 @@ void main() } }; -REGISTER_TEST(GL_Resource_Lifetimes); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_runtime_bind_prog_to_pipe.cpp b/util/test/demos/gl/gl_runtime_bind_prog_to_pipe.cpp index 91d5ea088..4d235ad48 100644 --- a/util/test/demos/gl/gl_runtime_bind_prog_to_pipe.cpp +++ b/util/test/demos/gl/gl_runtime_bind_prog_to_pipe.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct Runtime_Bind_Prog_To_Pipe : OpenGLGraphicsTest +TEST(GL_Runtime_Bind_Prog_To_Pipe, OpenGLGraphicsTest) { static constexpr const char *Description = "Creates a single program pipeline and binds different programs to it mid-frame"; @@ -141,4 +141,4 @@ void main() } }; -REGISTER_TEST(Runtime_Bind_Prog_To_Pipe); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_separable_geometry_shader.cpp b/util/test/demos/gl/gl_separable_geometry_shader.cpp index f19d0d0b5..152dd788b 100644 --- a/util/test/demos/gl/gl_separable_geometry_shader.cpp +++ b/util/test/demos/gl/gl_separable_geometry_shader.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct GL_Separable_Geometry_Shaders : OpenGLGraphicsTest +TEST(GL_Separable_Geometry_Shaders, OpenGLGraphicsTest) { static constexpr const char *Description = "Draws using geometry shadess and separable programs created with glCreateShaderProgramv"; @@ -206,4 +206,4 @@ void main() } }; -REGISTER_TEST(GL_Separable_Geometry_Shaders); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_simple_triangle.cpp b/util/test/demos/gl/gl_simple_triangle.cpp index 1fa916536..2e71bc4f9 100644 --- a/util/test/demos/gl/gl_simple_triangle.cpp +++ b/util/test/demos/gl/gl_simple_triangle.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct GL_Simple_Triangle : OpenGLGraphicsTest +TEST(GL_Simple_Triangle, OpenGLGraphicsTest) { static constexpr const char *Description = "Just draws a simple triangle, using normal pipeline. Basic test that can be used " @@ -119,4 +119,4 @@ void main() } }; -REGISTER_TEST(GL_Simple_Triangle); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_spirv_shader.cpp b/util/test/demos/gl/gl_spirv_shader.cpp index 15012d6ce..b34c97473 100644 --- a/util/test/demos/gl/gl_spirv_shader.cpp +++ b/util/test/demos/gl/gl_spirv_shader.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct SPIRV_Shader : OpenGLGraphicsTest +TEST(GL_SPIRV_Shader, OpenGLGraphicsTest) { static constexpr const char *Description = "Draws using a SPIR-V shader pipeline."; @@ -261,4 +261,4 @@ void main() } }; -REGISTER_TEST(SPIRV_Shader); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_structured_buffer_nested.cpp b/util/test/demos/gl/gl_structured_buffer_nested.cpp index 9db0f938e..82654c955 100644 --- a/util/test/demos/gl/gl_structured_buffer_nested.cpp +++ b/util/test/demos/gl/gl_structured_buffer_nested.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct GL_Structured_Buffer_Nested : OpenGLGraphicsTest +TEST(GL_Structured_Buffer_Nested, OpenGLGraphicsTest) { static constexpr const char *Description = "Just draws a simple triangle, using normal pipeline. Basic test that can be used " @@ -209,4 +209,4 @@ void main() } }; -REGISTER_TEST(GL_Structured_Buffer_Nested); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_unsized_ms_fbo_attachment.cpp b/util/test/demos/gl/gl_unsized_ms_fbo_attachment.cpp index 457b47131..051124adf 100644 --- a/util/test/demos/gl/gl_unsized_ms_fbo_attachment.cpp +++ b/util/test/demos/gl/gl_unsized_ms_fbo_attachment.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct Unsized_MS_FBO_Attachment : OpenGLGraphicsTest +TEST(GL_Unsized_MS_FBO_Attachment, OpenGLGraphicsTest) { static constexpr const char *Description = "Creates a MS FBO with one attachment created with an unsized internal format"; @@ -161,4 +161,4 @@ void main() } }; -REGISTER_TEST(Unsized_MS_FBO_Attachment); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/gl/gl_vao_0.cpp b/util/test/demos/gl/gl_vao_0.cpp index 778a6bd38..369da6758 100644 --- a/util/test/demos/gl/gl_vao_0.cpp +++ b/util/test/demos/gl/gl_vao_0.cpp @@ -24,7 +24,7 @@ #include "gl_test.h" -struct GL_VAO_0 : OpenGLGraphicsTest +TEST(GL_VAO_0, OpenGLGraphicsTest) { static constexpr const char *Description = "Uses VAO 0 (i.e. never binds a VAO)"; @@ -151,4 +151,4 @@ void main() } }; -REGISTER_TEST(GL_VAO_0); \ No newline at end of file +REGISTER_TEST(); \ No newline at end of file diff --git a/util/test/demos/main.cpp b/util/test/demos/main.cpp index 6a24b3a1d..8716ab62c 100644 --- a/util/test/demos/main.cpp +++ b/util/test/demos/main.cpp @@ -287,7 +287,7 @@ Usage: %s Test_Name [test_options] { if(prev != TestAPI::Count) printf("\n\n"); - printf("======== %s tests ========\n\n", test.APIName()); + printf("======== %s tests ========\n\n", APIName(test.API)); } prev = test.API; @@ -401,8 +401,7 @@ Usage: %s Test_Name [test_options] if(!tests[i].IsAvailable()) continue; - std::string name = tests[i].QualifiedName(); - std::string lower_name = strlower(name); + std::string lower_name = strlower(tests[i].Name); // apply filters if(!allow[(int)tests[i].API] || @@ -419,7 +418,7 @@ Usage: %s Test_Name [test_options] if(curtest == -1) curtest = i; - if(nk_select_label(ctx, name.c_str(), NK_TEXT_LEFT, curtest == i)) + if(nk_select_label(ctx, tests[i].Name, NK_TEXT_LEFT, curtest == i)) curtest = i; } @@ -446,7 +445,7 @@ Usage: %s Test_Name [test_options] nk_layout_row_push(ctx, 0.25f); nk_label(ctx, "API:", NK_TEXT_ALIGN_TOP | NK_TEXT_ALIGN_RIGHT); nk_layout_row_push(ctx, 0.75f); - nk_label(ctx, selected_test.APIName(), NK_TEXT_ALIGN_TOP | NK_TEXT_ALIGN_LEFT); + nk_label(ctx, APIName(selected_test.API), NK_TEXT_ALIGN_TOP | NK_TEXT_ALIGN_LEFT); nk_layout_row_end(ctx); nk_layout_row_begin(ctx, NK_DYNAMIC, 0, 2); diff --git a/util/test/demos/test_common.h b/util/test/demos/test_common.h index c5d11aa5e..ca03653e9 100644 --- a/util/test/demos/test_common.h +++ b/util/test/demos/test_common.h @@ -189,6 +189,20 @@ enum class TestAPI Count, }; +inline const char *APIName(TestAPI API) +{ + switch(API) + { + case TestAPI::D3D11: return "D3D11"; + case TestAPI::Vulkan: return "Vulkan"; + case TestAPI::OpenGL: return "OpenGL"; + case TestAPI::D3D12: return "D3D12"; + case TestAPI::Count: break; + } + + return "???"; +} + struct TestMetadata { TestAPI API; @@ -198,28 +212,6 @@ struct TestMetadata bool IsAvailable() const { return test->Avail.empty(); } const char *AvailMessage() const { return test->Avail.c_str(); } - std::string QualifiedName() const - { - std::string ret = APIName(); - ret += "::"; - ret += Name; - return ret; - } - - const char *APIName() const - { - switch(API) - { - case TestAPI::D3D11: return "D3D11"; - case TestAPI::Vulkan: return "VK"; - case TestAPI::OpenGL: return "GL"; - case TestAPI::D3D12: return "D3D12"; - case TestAPI::Count: break; - } - - return "???"; - } - bool operator<(const TestMetadata &o) { if(API != o.API) @@ -235,24 +227,32 @@ struct TestMetadata void RegisterTest(TestMetadata test); -#define REGISTER_TEST(TestName) \ - namespace \ - { \ - struct TestRegistration \ - { \ - TestName m_impl; \ - TestRegistration() \ - { \ - TestMetadata test; \ - test.API = TestName::API; \ - test.Name = #TestName; \ - test.Description = TestName::Description; \ - test.test = &m_impl; \ - RegisterTest(test); \ - } \ - }; \ - }; \ - static TestRegistration Anon##__LINE__; +#define TEST(Test, Parent) \ + struct Test; \ + typedef Test CurrentTest; \ + namespace \ + { \ + constexpr const char *TestName = #Test; \ + }; \ + struct Test : Parent + +#define REGISTER_TEST() \ + namespace \ + { \ + struct TestRegistration \ + { \ + CurrentTest m_impl; \ + TestRegistration() \ + { \ + TestMetadata test; \ + test.API = CurrentTest::API; \ + test.Name = TestName; \ + test.Description = CurrentTest::Description; \ + test.test = &m_impl; \ + RegisterTest(test); \ + } \ + } Anon##__LINE__; \ + }; std::string GetCWD(); std::string GetEnvVar(const char *var); diff --git a/util/test/demos/vk/vk_adv_cbuffer_zoo.cpp b/util/test/demos/vk/vk_adv_cbuffer_zoo.cpp index 655f6e8f3..2ab8237b2 100644 --- a/util/test/demos/vk/vk_adv_cbuffer_zoo.cpp +++ b/util/test/demos/vk/vk_adv_cbuffer_zoo.cpp @@ -108,7 +108,7 @@ struct UBO int8_t test; }; -struct VK_Adv_CBuffer_Zoo : VulkanGraphicsTest +TEST(VK_Adv_CBuffer_Zoo, VulkanGraphicsTest) { static constexpr const char *Description = "Tests VK_EXT_scalar_block_layout as well as 8-bit/16-bit storage " @@ -404,4 +404,4 @@ void main() } }; -REGISTER_TEST(VK_Adv_CBuffer_Zoo); \ No newline at end of file +REGISTER_TEST(); \ No newline at end of file diff --git a/util/test/demos/vk/vk_awkward_triangle.cpp b/util/test/demos/vk/vk_awkward_triangle.cpp index 081aeb54c..7b84457a9 100644 --- a/util/test/demos/vk/vk_awkward_triangle.cpp +++ b/util/test/demos/vk/vk_awkward_triangle.cpp @@ -24,7 +24,7 @@ #include "vk_test.h" -struct Awkward_Triangle : VulkanGraphicsTest +TEST(VK_Awkward_Triangle, VulkanGraphicsTest) { static constexpr const char *Description = "Draws a triangle but using vertex buffers in formats that only support VBs and not " @@ -170,4 +170,4 @@ void main() } }; -REGISTER_TEST(Awkward_Triangle); \ No newline at end of file +REGISTER_TEST(); \ No newline at end of file diff --git a/util/test/demos/vk/vk_buffer_address.cpp b/util/test/demos/vk/vk_buffer_address.cpp index 650dc3203..404b3c87d 100644 --- a/util/test/demos/vk/vk_buffer_address.cpp +++ b/util/test/demos/vk/vk_buffer_address.cpp @@ -30,7 +30,7 @@ #if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || \ defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) -struct VK_Buffer_Address : VulkanGraphicsTest +TEST(VK_Buffer_Address, VulkanGraphicsTest) { static constexpr const char *Description = "Test capture and replay of VK_EXT_buffer_reference"; @@ -280,6 +280,6 @@ void main() } }; -REGISTER_TEST(VK_Buffer_Address); +REGISTER_TEST(); #endif // if 64-bit \ No newline at end of file diff --git a/util/test/demos/vk/vk_cbuffer_zoo.cpp b/util/test/demos/vk/vk_cbuffer_zoo.cpp index 04116df72..fee5eeadb 100644 --- a/util/test/demos/vk/vk_cbuffer_zoo.cpp +++ b/util/test/demos/vk/vk_cbuffer_zoo.cpp @@ -24,7 +24,7 @@ #include "vk_test.h" -struct VK_CBuffer_Zoo : VulkanGraphicsTest +TEST(VK_CBuffer_Zoo, VulkanGraphicsTest) { static constexpr const char *Description = "Tests every kind of constant that can be in a cbuffer to make sure it's decoded correctly."; @@ -633,4 +633,4 @@ float4 main() : SV_Target0 } }; -REGISTER_TEST(VK_CBuffer_Zoo); \ No newline at end of file +REGISTER_TEST(); \ No newline at end of file diff --git a/util/test/demos/vk/vk_descriptor_index.cpp b/util/test/demos/vk/vk_descriptor_index.cpp index a88d4bbfb..9ea559264 100644 --- a/util/test/demos/vk/vk_descriptor_index.cpp +++ b/util/test/demos/vk/vk_descriptor_index.cpp @@ -46,7 +46,7 @@ #define STRINGISE2(a) #a #define STRINGISE(a) STRINGISE2(a) -struct VK_Descriptor_Indexing : VulkanGraphicsTest +TEST(VK_Descriptor_Indexing, VulkanGraphicsTest) { static constexpr const char *Description = "Draws a triangle using descriptor indexing with large descriptor sets."; @@ -583,4 +583,4 @@ void main() } }; -REGISTER_TEST(VK_Descriptor_Indexing); \ No newline at end of file +REGISTER_TEST(); \ No newline at end of file diff --git a/util/test/demos/vk/vk_discard_rects.cpp b/util/test/demos/vk/vk_discard_rects.cpp index 9ea2f8332..e3763eb52 100644 --- a/util/test/demos/vk/vk_discard_rects.cpp +++ b/util/test/demos/vk/vk_discard_rects.cpp @@ -24,7 +24,7 @@ #include "vk_test.h" -struct VK_Discard_Rectangles : VulkanGraphicsTest +TEST(VK_Discard_Rectangles, VulkanGraphicsTest) { static constexpr const char *Description = "Draws a large number of triangles using VK_EXT_discard_rectangles discard rectangles to " @@ -210,4 +210,4 @@ void main() } }; -REGISTER_TEST(VK_Discard_Rectangles); \ No newline at end of file +REGISTER_TEST(); \ No newline at end of file diff --git a/util/test/demos/vk/vk_draw_zoo.cpp b/util/test/demos/vk/vk_draw_zoo.cpp index d5112b939..afd89c4a2 100644 --- a/util/test/demos/vk/vk_draw_zoo.cpp +++ b/util/test/demos/vk/vk_draw_zoo.cpp @@ -24,7 +24,7 @@ #include "vk_test.h" -struct VK_Draw_Zoo : VulkanGraphicsTest +TEST(VK_Draw_Zoo, VulkanGraphicsTest) { static constexpr const char *Description = "Draws several variants using different vertex/index offsets."; @@ -480,4 +480,4 @@ void main() } }; -REGISTER_TEST(VK_Draw_Zoo); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/vk/vk_indirect.cpp b/util/test/demos/vk/vk_indirect.cpp index c7472f42a..2b57999d4 100644 --- a/util/test/demos/vk/vk_indirect.cpp +++ b/util/test/demos/vk/vk_indirect.cpp @@ -24,7 +24,7 @@ #include "vk_test.h" -struct VK_Indirect : VulkanGraphicsTest +TEST(VK_Indirect, VulkanGraphicsTest) { static constexpr const char *Description = "Tests different indirect drawing and dispatching functions, including parameters that are " @@ -543,4 +543,4 @@ void main() } }; -REGISTER_TEST(VK_Indirect); \ No newline at end of file +REGISTER_TEST(); \ No newline at end of file diff --git a/util/test/demos/vk/vk_overlay_test.cpp b/util/test/demos/vk/vk_overlay_test.cpp index 3aad98e6f..ab45f4238 100644 --- a/util/test/demos/vk/vk_overlay_test.cpp +++ b/util/test/demos/vk/vk_overlay_test.cpp @@ -24,7 +24,7 @@ #include "vk_test.h" -struct VK_Overlay_Test : VulkanGraphicsTest +TEST(VK_Overlay_Test, VulkanGraphicsTest) { static constexpr const char *Description = "Makes a couple of draws that show off all the overlays in some way"; @@ -286,4 +286,4 @@ void main() } }; -REGISTER_TEST(VK_Overlay_Test); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/vk/vk_resource_lifetimes.cpp b/util/test/demos/vk/vk_resource_lifetimes.cpp index 1f2cc62b6..ead9f8e72 100644 --- a/util/test/demos/vk/vk_resource_lifetimes.cpp +++ b/util/test/demos/vk/vk_resource_lifetimes.cpp @@ -24,7 +24,7 @@ #include "vk_test.h" -struct VK_Resource_Lifetimes : VulkanGraphicsTest +TEST(VK_Resource_Lifetimes, VulkanGraphicsTest) { static constexpr const char *Description = "Test various edge-case resource lifetimes: a resource that is first dirtied within a frame " @@ -567,4 +567,4 @@ void main() } }; -REGISTER_TEST(VK_Resource_Lifetimes); \ No newline at end of file +REGISTER_TEST(); \ No newline at end of file diff --git a/util/test/demos/vk/vk_sample_locations.cpp b/util/test/demos/vk/vk_sample_locations.cpp index af37deec2..6377cc9d9 100644 --- a/util/test/demos/vk/vk_sample_locations.cpp +++ b/util/test/demos/vk/vk_sample_locations.cpp @@ -24,7 +24,7 @@ #include "vk_test.h" -struct VK_Sample_Locations : VulkanGraphicsTest +TEST(VK_Sample_Locations, VulkanGraphicsTest) { static constexpr const char *Description = "Draws two triangles with different sample locations using VK_EXT_sample_locations"; @@ -302,4 +302,4 @@ void main() } }; -REGISTER_TEST(VK_Sample_Locations); \ No newline at end of file +REGISTER_TEST(); \ No newline at end of file diff --git a/util/test/demos/vk/vk_secondary_cmdbuf.cpp b/util/test/demos/vk/vk_secondary_cmdbuf.cpp index 52e98f39b..4fe9be093 100644 --- a/util/test/demos/vk/vk_secondary_cmdbuf.cpp +++ b/util/test/demos/vk/vk_secondary_cmdbuf.cpp @@ -24,7 +24,7 @@ #include "vk_test.h" -struct VK_Secondary_CmdBuf : VulkanGraphicsTest +TEST(VK_Secondary_CmdBuf, VulkanGraphicsTest) { static constexpr const char *Description = "Draw using secondary command buffers"; @@ -238,4 +238,4 @@ void main() } }; -REGISTER_TEST(VK_Secondary_CmdBuf); \ No newline at end of file +REGISTER_TEST(); \ No newline at end of file diff --git a/util/test/demos/vk/vk_simple_triangle.cpp b/util/test/demos/vk/vk_simple_triangle.cpp index 57523ff54..41673890f 100644 --- a/util/test/demos/vk/vk_simple_triangle.cpp +++ b/util/test/demos/vk/vk_simple_triangle.cpp @@ -24,7 +24,7 @@ #include "vk_test.h" -struct VK_Simple_Triangle : VulkanGraphicsTest +TEST(VK_Simple_Triangle, VulkanGraphicsTest) { static constexpr const char *Description = "Just draws a simple triangle, using normal pipeline. Basic test that can be used " @@ -145,4 +145,4 @@ void main() } }; -REGISTER_TEST(VK_Simple_Triangle); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/vk/vk_structured_buffer_nested.cpp b/util/test/demos/vk/vk_structured_buffer_nested.cpp index 3168240c7..b5fbe4cad 100644 --- a/util/test/demos/vk/vk_structured_buffer_nested.cpp +++ b/util/test/demos/vk/vk_structured_buffer_nested.cpp @@ -24,7 +24,7 @@ #include "vk_test.h" -struct VK_Structured_Buffer_Nested : VulkanGraphicsTest +TEST(VK_Structured_Buffer_Nested, VulkanGraphicsTest) { static constexpr const char *Description = "Just draws a simple triangle, using normal pipeline. Basic test that can be used " @@ -337,4 +337,4 @@ float4 main() : SV_Target0 } }; -REGISTER_TEST(VK_Structured_Buffer_Nested); \ No newline at end of file +REGISTER_TEST(); diff --git a/util/test/demos/vk/vk_video_textures.cpp b/util/test/demos/vk/vk_video_textures.cpp index ee011697e..e86267486 100644 --- a/util/test/demos/vk/vk_video_textures.cpp +++ b/util/test/demos/vk/vk_video_textures.cpp @@ -37,7 +37,7 @@ /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// -struct VK_Video_Textures : VulkanGraphicsTest +TEST(VK_Video_Textures, VulkanGraphicsTest) { static constexpr const char *Description = "Tests of YUV textures"; @@ -993,4 +993,4 @@ void main() } }; -REGISTER_TEST(VK_Video_Textures); \ No newline at end of file +REGISTER_TEST(); \ No newline at end of file diff --git a/util/test/demos/vk/vk_vs_max_desc_set.cpp b/util/test/demos/vk/vk_vs_max_desc_set.cpp index 772a5a781..fec2816e8 100644 --- a/util/test/demos/vk/vk_vs_max_desc_set.cpp +++ b/util/test/demos/vk/vk_vs_max_desc_set.cpp @@ -24,7 +24,7 @@ #include "vk_test.h" -struct VK_VS_Max_Desc_Set : VulkanGraphicsTest +TEST(VK_VS_Max_Desc_Set, VulkanGraphicsTest) { static constexpr const char *Description = "Uses the device's maximum number of descriptor sets in the vertex shader."; @@ -197,4 +197,4 @@ void main() } }; -REGISTER_TEST(VK_VS_Max_Desc_Set); \ No newline at end of file +REGISTER_TEST(); \ No newline at end of file