From 598ae163e9216a56b7deaf53b34b43c8c3cddc63 Mon Sep 17 00:00:00 2001 From: DragonJoker Date: Wed, 23 Mar 2022 18:18:19 +0100 Subject: [PATCH] Split of tests per type or image format. --- test/Common.hpp | 49 +++++--- test/ShaderWriter/CMakeLists.txt | 101 +++++++++++++++- .../TestWriterArraySsboDeclarations.cpp | 76 +----------- .../TestWriterCombinedImageAccesses.cpp | 31 +---- .../TestWriterCombinedImageDeclarations.cpp | 31 +---- .../TestWriterPcbDeclarations.cpp | 41 +------ .../TestWriterSampledImageAccesses.cpp | 25 +--- .../TestWriterSampledImageDeclarations.cpp | 31 +---- .../TestWriterSsboDeclarations.cpp | 41 +------ .../TestWriterStorageImageAccesses.cpp | 108 ++++-------------- .../TestWriterStorageImageDeclarations.cpp | 25 +--- .../TestWriterStructDeclarations.cpp | 41 +------ .../TestWriterUboDeclarations.cpp | 41 +------ test/ShaderWriter/WriterCommon.hpp | 4 +- 14 files changed, 200 insertions(+), 445 deletions(-) diff --git a/test/Common.hpp b/test/Common.hpp index deeaeb98..541ffd3b 100644 --- a/test/Common.hpp +++ b/test/Common.hpp @@ -221,12 +221,31 @@ namespace test # define testSuiteMain( testName )\ static test::TestResults launch##testName( test::TestSuite & suite, test::TestCounts & testCounts ) +#if defined( _MSC_VER ) +# define testEval( V ) V + +# define testConcat2( lhs, rhs )\ + testEval( lhs ) ## testEval( rhs ) + +# define testConcat3( lhs, mid, rhs )\ + testConcat2( lhs, mid ) ## testEval( rhs ) + +# define testConcat( lhs, rhs )\ + testConcat3( lhs, _, rhs ) +#else +# define testConcat2( lhs, rhs )\ + lhs ## rhs + +# define testConcat( lhs, rhs )\ + lhs ## _ ## rhs +#endif + #if defined( SDW_COMPILE_TESTS ) # define testSuiteLaunchEx( testName, suiteType )\ int main( int argv, char ** argc )\ {\ suiteType suite{ #testName };\ - suite.registerTests< suiteType >( #testName, launch##testName );\ + suite.registerTests< suiteType >( #testName, testConcat2( launch, testName ) );\ return suite.run();\ } #else @@ -239,14 +258,14 @@ namespace test #define testStringify( x )\ #x -#define testConcat2( x, y )\ +#define testConcatStr2( x, y )\ testStringify( x ) testStringify( y ) -#define testConcat3( x, y, z )\ - testConcat2( x, y ) testStringify( z ) +#define testConcatStr3( x, y, z )\ + testConcatStr2( x, y ) testStringify( z ) -#define testConcat4( x, y, z, w )\ - testConcat3( x, y, z ) testStringify( w ) +#define testConcatStr4( x, y, z, w )\ + testConcatStr3( x, y, z ) testStringify( w ) #define testSuiteBeginEx( testCounts )\ testCounts.initialise();\ @@ -304,7 +323,7 @@ namespace test }\ catch ( ... )\ {\ - test::reportFailure( testConcat2( x, " failed." ), __FUNCTION__, __LINE__, testCounts );\ + test::reportFailure( testConcatStr2( x, " failed." ), __FUNCTION__, __LINE__, testCounts );\ } #define beginRequire( x )\ @@ -320,7 +339,7 @@ namespace test }\ catch ( ... )\ {\ - test::reportFailure( testConcat2( x, " failed." ), __FUNCTION__, __LINE__, testCounts );\ + test::reportFailure( testConcatStr2( x, " failed." ), __FUNCTION__, __LINE__, testCounts );\ } #define check( x )\ @@ -329,12 +348,12 @@ namespace test testCounts.incTest();\ if ( !( x ) )\ {\ - test::reportFailure( testConcat2( x, " failed." ), __FUNCTION__, __LINE__, testCounts );\ + test::reportFailure( testConcatStr2( x, " failed." ), __FUNCTION__, __LINE__, testCounts );\ }\ }\ catch ( ... )\ {\ - test::reportFailure( testConcat2( x, " failed: Unhandled exception." ), __FUNCTION__, __LINE__, testCounts );\ + test::reportFailure( testConcatStr2( x, " failed: Unhandled exception." ), __FUNCTION__, __LINE__, testCounts );\ } #define checkEqual( x, y )\ @@ -348,7 +367,7 @@ namespace test }\ catch ( ... )\ {\ - test::reportFailure( testConcat4( x, " == ", y, " failed." ), __FUNCTION__, __LINE__, testCounts );\ + test::reportFailure( testConcatStr4( x, " == ", y, " failed." ), __FUNCTION__, __LINE__, testCounts );\ } #define checkNotEqual( x, y )\ @@ -362,7 +381,7 @@ namespace test }\ catch ( ... )\ {\ - test::reportFailure( testConcat4( x, " != ", y, " failed." ), __FUNCTION__, __LINE__, testCounts );\ + test::reportFailure( testConcatStr4( x, " != ", y, " failed." ), __FUNCTION__, __LINE__, testCounts );\ } #define checkThrow( x )\ @@ -370,7 +389,7 @@ namespace test {\ testCounts.incTest();\ ( x ); \ - test::reportFailure( testConcat2( x, " failed." ), __FUNCTION__, __LINE__, testCounts );\ + test::reportFailure( testConcatStr2( x, " failed." ), __FUNCTION__, __LINE__, testCounts );\ }\ catch ( ... )\ {\ @@ -385,10 +404,10 @@ namespace test catch ( std::exception & exc )\ {\ test::reportFailure( exc.what(), __FUNCTION__, __LINE__, testCounts );\ - test::reportFailure( testConcat2( x, " failed." ), __FUNCTION__, __LINE__, testCounts );\ + test::reportFailure( testConcatStr2( x, " failed." ), __FUNCTION__, __LINE__, testCounts );\ }\ catch ( ... )\ {\ - test::reportFailure( testConcat2( x, " failed." ), __FUNCTION__, __LINE__, testCounts );\ + test::reportFailure( testConcatStr2( x, " failed." ), __FUNCTION__, __LINE__, testCounts );\ } } diff --git a/test/ShaderWriter/CMakeLists.txt b/test/ShaderWriter/CMakeLists.txt index 9e02f8fa..ebe672c6 100644 --- a/test/ShaderWriter/CMakeLists.txt +++ b/test/ShaderWriter/CMakeLists.txt @@ -247,8 +247,71 @@ if ( PROJECTS_COVERAGE ) ) endif () -foreach ( TEST_FILE ${TEST_FILES} ) - get_filename_component( TEST_NAME ${TEST_FILE} NAME_WE ) +set( IMAGE_FORMATS + eRgba32f + eRgba16f + eRg32f + eRg16f + eR32f + eR16f + eRgba32i + eRgba16i + eRgba8i + eRg32i + eRg16i + eRg8i + eR32i + eR16i + eR8i + eRgba32u + eRgba16u + eRgba8u + eRg32u + eRg16u + eRg8u + eR32u + eR16u + eR8u +) + +set( BO_TYPES + Int + UInt + Float + Double + Vec2 + Vec3 + Vec4 + DVec2 + DVec3 + DVec4 + IVec2 + IVec3 + IVec4 + UVec2 + UVec3 + UVec4 + Mat2x2 + Mat2x3 + Mat2x4 + Mat3x2 + Mat3x3 + Mat3x4 + Mat4x2 + Mat4x3 + Mat4x4 + DMat2x2 + DMat2x3 + DMat2x4 + DMat3x2 + DMat3x3 + DMat3x4 + DMat4x2 + DMat4x3 + DMat4x4 +) + +function( SDW_AddTest TEST_FILE TEST_NAME ADDITIONAL_DEFINITIONS ) if ( PROJECTS_COVERAGE ) set( PROJECTS_COVERAGE_SRC_FILES ${PROJECTS_COVERAGE_SRC_FILES} @@ -271,6 +334,7 @@ foreach ( TEST_FILE ${TEST_FILES} ) ) target_compile_definitions( ${TEST_NAME} PRIVATE ${TargetCompileDefinitions} + ${ADDITIONAL_DEFINITIONS} SDW_COMPILE_TESTS ) target_add_compilation_flags( ${TEST_NAME} ) @@ -296,6 +360,39 @@ foreach ( TEST_FILE ${TEST_FILES} ) NAME ${TEST_NAME} COMMAND ${TEST_NAME} ) +endfunction( SDW_AddTest ) + +foreach ( TEST_FILE ${TEST_FILES} ) + get_filename_component( TEST_NAME ${TEST_FILE} NAME_WE ) + string( FIND ${TEST_FILE} "Image" IS_IMAGE ) + string( FIND ${TEST_FILE} "Ssbo" IS_SSBO ) + string( FIND ${TEST_FILE} "Ubo" IS_UBO ) + string( FIND ${TEST_FILE} "Struct" IS_STRUCT ) + string( FIND ${TEST_FILE} "Pcb" IS_PCB ) + + if ( IS_IMAGE GREATER -1 ) + foreach( FORMAT ${IMAGE_FORMATS} ) + SDW_AddTest( ${TEST_FILE} ${TEST_NAME}_${FORMAT} "SDW_TestImageFormat=${FORMAT}" ) + endforeach () + elseif ( IS_SSBO GREATER -1 ) + foreach( BO_TYPE ${BO_TYPES} ) + SDW_AddTest( ${TEST_FILE} ${TEST_NAME}_${BO_TYPE} "SDW_TestType=${BO_TYPE}" ) + endforeach () + elseif ( IS_UBO GREATER -1 ) + foreach( BO_TYPE ${BO_TYPES} ) + SDW_AddTest( ${TEST_FILE} ${TEST_NAME}_${BO_TYPE} "SDW_TestType=${BO_TYPE}" ) + endforeach () + elseif ( IS_STRUCT GREATER -1 ) + foreach( BO_TYPE ${BO_TYPES} ) + SDW_AddTest( ${TEST_FILE} ${TEST_NAME}_${BO_TYPE} "SDW_TestType=${BO_TYPE}" ) + endforeach () + elseif ( IS_PCB GREATER -1 ) + foreach( BO_TYPE ${BO_TYPES} ) + SDW_AddTest( ${TEST_FILE} ${TEST_NAME}_${BO_TYPE} "SDW_TestType=${BO_TYPE}" ) + endforeach () + else () + SDW_AddTest( ${TEST_FILE} ${TEST_NAME} "" ) + endif () endforeach () if ( PROJECTS_COVERAGE ) diff --git a/test/ShaderWriter/TestWriterArraySsboDeclarations.cpp b/test/ShaderWriter/TestWriterArraySsboDeclarations.cpp index 57fb24a9..6ba585b9 100644 --- a/test/ShaderWriter/TestWriterArraySsboDeclarations.cpp +++ b/test/ShaderWriter/TestWriterArraySsboDeclarations.cpp @@ -131,78 +131,14 @@ namespace } } -sdwTestSuiteMain( TestWriterArraySsboDeclarations ) +#define testName testConcat( TestWriterArraySsboDeclarations, SDW_TestType ) + +sdwTestSuiteMain( testName ) { sdwTestSuiteBegin(); - testStructuredSsbo< sdw::Int >( testCounts ); - testStructuredSsbo< sdw::UInt >( testCounts ); - testStructuredSsbo< sdw::Float >( testCounts ); - testStructuredSsbo< sdw::Double >( testCounts ); - testStructuredSsbo< sdw::Vec2 >( testCounts ); - testStructuredSsbo< sdw::Vec3 >( testCounts ); - testStructuredSsbo< sdw::Vec4 >( testCounts ); - testStructuredSsbo< sdw::DVec2 >( testCounts ); - testStructuredSsbo< sdw::DVec3 >( testCounts ); - testStructuredSsbo< sdw::DVec4 >( testCounts ); - testStructuredSsbo< sdw::IVec2 >( testCounts ); - testStructuredSsbo< sdw::IVec3 >( testCounts ); - testStructuredSsbo< sdw::IVec4 >( testCounts ); - testStructuredSsbo< sdw::UVec2 >( testCounts ); - testStructuredSsbo< sdw::UVec3 >( testCounts ); - testStructuredSsbo< sdw::UVec4 >( testCounts ); - testStructuredSsbo< sdw::Mat2 >( testCounts ); - testStructuredSsbo< sdw::Mat2x3 >( testCounts ); - testStructuredSsbo< sdw::Mat2x4 >( testCounts ); - testStructuredSsbo< sdw::Mat3 >( testCounts ); - testStructuredSsbo< sdw::Mat3x2 >( testCounts ); - testStructuredSsbo< sdw::Mat3x4 >( testCounts ); - testStructuredSsbo< sdw::Mat4 >( testCounts ); - testStructuredSsbo< sdw::Mat4x2 >( testCounts ); - testStructuredSsbo< sdw::Mat4x3 >( testCounts ); - testStructuredSsbo< sdw::DMat2 >( testCounts ); - testStructuredSsbo< sdw::DMat2x3 >( testCounts ); - testStructuredSsbo< sdw::DMat2x4 >( testCounts ); - testStructuredSsbo< sdw::DMat3 >( testCounts ); - testStructuredSsbo< sdw::DMat3x2 >( testCounts ); - testStructuredSsbo< sdw::DMat3x4 >( testCounts ); - testStructuredSsbo< sdw::DMat4 >( testCounts ); - testStructuredSsbo< sdw::DMat4x2 >( testCounts ); - testStructuredSsbo< sdw::DMat4x3 >( testCounts ); - testArraySsbo< sdw::Int >( testCounts ); - testArraySsbo< sdw::UInt >( testCounts ); - testArraySsbo< sdw::Float >( testCounts ); - testArraySsbo< sdw::Double >( testCounts ); - testArraySsbo< sdw::Vec2 >( testCounts ); - testArraySsbo< sdw::Vec3 >( testCounts ); - testArraySsbo< sdw::Vec4 >( testCounts ); - testArraySsbo< sdw::DVec2 >( testCounts ); - testArraySsbo< sdw::DVec3 >( testCounts ); - testArraySsbo< sdw::DVec4 >( testCounts ); - testArraySsbo< sdw::IVec2 >( testCounts ); - testArraySsbo< sdw::IVec3 >( testCounts ); - testArraySsbo< sdw::IVec4 >( testCounts ); - testArraySsbo< sdw::UVec2 >( testCounts ); - testArraySsbo< sdw::UVec3 >( testCounts ); - testArraySsbo< sdw::UVec4 >( testCounts ); - testArraySsbo< sdw::Mat2 >( testCounts ); - testArraySsbo< sdw::Mat2x3 >( testCounts ); - testArraySsbo< sdw::Mat2x4 >( testCounts ); - testArraySsbo< sdw::Mat3 >( testCounts ); - testArraySsbo< sdw::Mat3x2 >( testCounts ); - testArraySsbo< sdw::Mat3x4 >( testCounts ); - testArraySsbo< sdw::Mat4 >( testCounts ); - testArraySsbo< sdw::Mat4x2 >( testCounts ); - testArraySsbo< sdw::Mat4x3 >( testCounts ); - testArraySsbo< sdw::DMat2 >( testCounts ); - testArraySsbo< sdw::DMat2x3 >( testCounts ); - testArraySsbo< sdw::DMat2x4 >( testCounts ); - testArraySsbo< sdw::DMat3 >( testCounts ); - testArraySsbo< sdw::DMat3x2 >( testCounts ); - testArraySsbo< sdw::DMat3x4 >( testCounts ); - testArraySsbo< sdw::DMat4 >( testCounts ); - testArraySsbo< sdw::DMat4x2 >( testCounts ); - testArraySsbo< sdw::DMat4x3 >( testCounts ); + testStructuredSsbo< sdw::SDW_TestType >( testCounts ); + testArraySsbo< sdw::SDW_TestType >( testCounts ); sdwTestSuiteEnd(); } -sdwTestSuiteLaunch( TestWriterArraySsboDeclarations ) +sdwTestSuiteLaunch( testName ) diff --git a/test/ShaderWriter/TestWriterCombinedImageAccesses.cpp b/test/ShaderWriter/TestWriterCombinedImageAccesses.cpp index 4bfe4cbc..73a0ee19 100644 --- a/test/ShaderWriter/TestWriterCombinedImageAccesses.cpp +++ b/test/ShaderWriter/TestWriterCombinedImageAccesses.cpp @@ -2230,30 +2230,7 @@ namespace template< template< ast::type::ImageFormat, ast::type::ImageDim, bool, bool, bool, typename Enable = void > typename TesterT > void testsTextures( test::sdw_test::TestCounts & testCounts ) { - testsTexture< ast::type::ImageFormat::eRgba32f, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRgba16f, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg32f, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg16f, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR32f, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR16f, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRgba32i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRgba16i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRgba8i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg32i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg16i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg8i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR32i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR16i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR8i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRgba32u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRgba16u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRgba8u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg32u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg16u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg8u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR32u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR16u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR8u, TesterT >( testCounts ); + testsTexture< ast::type::ImageFormat::SDW_TestImageFormat, TesterT >( testCounts ); } /**@}*/ #pragma endregion @@ -2261,7 +2238,9 @@ namespace #endif -sdwTestSuiteMain( TestWriterCombinedImageAccesses ) +#define testName testConcat( TestWriterCombinedImageAccesses, SDW_TestImageFormat ) + +sdwTestSuiteMain( testName ) { sdwTestSuiteBegin(); #if !defined( __APPLE__ ) @@ -2296,4 +2275,4 @@ sdwTestSuiteMain( TestWriterCombinedImageAccesses ) sdwTestSuiteEnd(); } -sdwTestSuiteLaunch( TestWriterCombinedImageAccesses ) +sdwTestSuiteLaunch( testName ) diff --git a/test/ShaderWriter/TestWriterCombinedImageDeclarations.cpp b/test/ShaderWriter/TestWriterCombinedImageDeclarations.cpp index c3b3903c..1d9a4763 100644 --- a/test/ShaderWriter/TestWriterCombinedImageDeclarations.cpp +++ b/test/ShaderWriter/TestWriterCombinedImageDeclarations.cpp @@ -232,34 +232,13 @@ namespace } } -sdwTestSuiteMain( TestWriterCombinedImageDeclarations ) +#define testName testConcat( TestWriterCombinedImageDeclarations, SDW_TestImageFormat ) + +sdwTestSuiteMain( testName ) { sdwTestSuiteBegin(); - testTextureFormat< ast::type::ImageFormat::eRgba32f >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eRgba16f >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eRg32f >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eRg16f >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eR32f >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eR16f >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eRgba32i >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eRgba16i >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eRgba8i >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eRg32i >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eRg16i >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eRg8i >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eR32i >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eR16i >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eR8i >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eRgba32u >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eRgba16u >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eRgba8u >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eRg32u >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eRg16u >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eRg8u >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eR32u >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eR16u >( testCounts ); - testTextureFormat< ast::type::ImageFormat::eR8u >( testCounts ); + testTextureFormat< ast::type::ImageFormat::SDW_TestImageFormat >( testCounts ); sdwTestSuiteEnd(); } -sdwTestSuiteLaunch( TestWriterCombinedImageDeclarations ) +sdwTestSuiteLaunch( testName ) diff --git a/test/ShaderWriter/TestWriterPcbDeclarations.cpp b/test/ShaderWriter/TestWriterPcbDeclarations.cpp index e6cddcd8..664777b1 100644 --- a/test/ShaderWriter/TestWriterPcbDeclarations.cpp +++ b/test/ShaderWriter/TestWriterPcbDeclarations.cpp @@ -242,44 +242,13 @@ namespace } } -sdwTestSuiteMain( TestWriterPcbDeclarations ) +#define testName testConcat( TestWriterPcbDeclarations, SDW_TestType ) + +sdwTestSuiteMain( testName ) { sdwTestSuiteBegin(); - testPcb< sdw::Int >( testCounts ); - testPcb< sdw::UInt >( testCounts ); - testPcb< sdw::Float >( testCounts ); - testPcb< sdw::Double >( testCounts ); - testPcb< sdw::Vec2 >( testCounts ); - testPcb< sdw::Vec3 >( testCounts ); - testPcb< sdw::Vec4 >( testCounts ); - testPcb< sdw::DVec2 >( testCounts ); - testPcb< sdw::DVec3 >( testCounts ); - testPcb< sdw::DVec4 >( testCounts ); - testPcb< sdw::IVec2 >( testCounts ); - testPcb< sdw::IVec3 >( testCounts ); - testPcb< sdw::IVec4 >( testCounts ); - testPcb< sdw::UVec2 >( testCounts ); - testPcb< sdw::UVec3 >( testCounts ); - testPcb< sdw::UVec4 >( testCounts ); - testPcb< sdw::Mat2 >( testCounts ); - testPcb< sdw::Mat2x3 >( testCounts ); - testPcb< sdw::Mat2x4 >( testCounts ); - testPcb< sdw::Mat3 >( testCounts ); - testPcb< sdw::Mat3x2 >( testCounts ); - testPcb< sdw::Mat3x4 >( testCounts ); - testPcb< sdw::Mat4 >( testCounts ); - testPcb< sdw::Mat4x2 >( testCounts ); - testPcb< sdw::Mat4x3 >( testCounts ); - testPcb< sdw::DMat2 >( testCounts ); - testPcb< sdw::DMat2x3 >( testCounts ); - testPcb< sdw::DMat2x4 >( testCounts ); - testPcb< sdw::DMat3 >( testCounts ); - testPcb< sdw::DMat3x2 >( testCounts ); - testPcb< sdw::DMat3x4 >( testCounts ); - testPcb< sdw::DMat4 >( testCounts ); - testPcb< sdw::DMat4x2 >( testCounts ); - testPcb< sdw::DMat4x3 >( testCounts ); + testPcb< sdw::SDW_TestType >( testCounts ); sdwTestSuiteEnd(); } -sdwTestSuiteLaunch( TestWriterPcbDeclarations ) +sdwTestSuiteLaunch( testName ) diff --git a/test/ShaderWriter/TestWriterSampledImageAccesses.cpp b/test/ShaderWriter/TestWriterSampledImageAccesses.cpp index b346cad8..26eb1ce3 100644 --- a/test/ShaderWriter/TestWriterSampledImageAccesses.cpp +++ b/test/ShaderWriter/TestWriterSampledImageAccesses.cpp @@ -1935,30 +1935,7 @@ namespace template< template< ast::type::ImageFormat, ast::type::ImageDim, bool, bool, bool, typename Enable = void > typename TesterT > void testsTextures( test::sdw_test::TestCounts & testCounts ) { - testsTexture< ast::type::ImageFormat::eRgba32f, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRgba16f, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg32f, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg16f, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR32f, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR16f, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRgba32i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRgba16i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRgba8i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg32i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg16i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg8i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR32i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR16i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR8i, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRgba32u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRgba16u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRgba8u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg32u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg16u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eRg8u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR32u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR16u, TesterT >( testCounts ); - testsTexture< ast::type::ImageFormat::eR8u, TesterT >( testCounts ); + testsTexture< ast::type::ImageFormat::SDW_TestImageFormat, TesterT >( testCounts ); } /**@}*/ #pragma endregion diff --git a/test/ShaderWriter/TestWriterSampledImageDeclarations.cpp b/test/ShaderWriter/TestWriterSampledImageDeclarations.cpp index 029acbf9..2f097e7c 100644 --- a/test/ShaderWriter/TestWriterSampledImageDeclarations.cpp +++ b/test/ShaderWriter/TestWriterSampledImageDeclarations.cpp @@ -414,34 +414,13 @@ namespace } } -sdwTestSuiteMain( TestWriterSampledImageDeclarations ) +#define testName testConcat( TestWriterSampledImageDeclarations, SDW_TestImageFormat ) + +sdwTestSuiteMain( testName ) { sdwTestSuiteBegin(); - testSampledFormat< ast::type::ImageFormat::eRgba32f >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eRgba16f >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eRg32f >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eRg16f >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eR32f >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eR16f >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eRgba32i >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eRgba16i >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eRgba8i >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eRg32i >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eRg16i >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eRg8i >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eR32i >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eR16i >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eR8i >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eRgba32u >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eRgba16u >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eRgba8u >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eRg32u >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eRg16u >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eRg8u >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eR32u >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eR16u >( testCounts ); - testSampledFormat< ast::type::ImageFormat::eR8u >( testCounts ); + testSampledFormat< ast::type::ImageFormat::SDW_TestImageFormat >( testCounts ); sdwTestSuiteEnd(); } -sdwTestSuiteLaunch( TestWriterSampledImageDeclarations ) +sdwTestSuiteLaunch( testName ) diff --git a/test/ShaderWriter/TestWriterSsboDeclarations.cpp b/test/ShaderWriter/TestWriterSsboDeclarations.cpp index 039eebc7..f01b4605 100644 --- a/test/ShaderWriter/TestWriterSsboDeclarations.cpp +++ b/test/ShaderWriter/TestWriterSsboDeclarations.cpp @@ -338,44 +338,13 @@ namespace } } -sdwTestSuiteMain( TestWriterSsboDeclarations ) +#define testName testConcat( TestWriterSsboDeclarations, SDW_TestType ) + +sdwTestSuiteMain( testName ) { sdwTestSuiteBegin(); - testSsbo< sdw::Int >( testCounts ); - testSsbo< sdw::UInt >( testCounts ); - testSsbo< sdw::Float >( testCounts ); - testSsbo< sdw::Double >( testCounts ); - testSsbo< sdw::Vec2 >( testCounts ); - testSsbo< sdw::Vec3 >( testCounts ); - testSsbo< sdw::Vec4 >( testCounts ); - testSsbo< sdw::DVec2 >( testCounts ); - testSsbo< sdw::DVec3 >( testCounts ); - testSsbo< sdw::DVec4 >( testCounts ); - testSsbo< sdw::IVec2 >( testCounts ); - testSsbo< sdw::IVec3 >( testCounts ); - testSsbo< sdw::IVec4 >( testCounts ); - testSsbo< sdw::UVec2 >( testCounts ); - testSsbo< sdw::UVec3 >( testCounts ); - testSsbo< sdw::UVec4 >( testCounts ); - testSsbo< sdw::Mat2 >( testCounts ); - testSsbo< sdw::Mat2x3 >( testCounts ); - testSsbo< sdw::Mat2x4 >( testCounts ); - testSsbo< sdw::Mat3 >( testCounts ); - testSsbo< sdw::Mat3x2 >( testCounts ); - testSsbo< sdw::Mat3x4 >( testCounts ); - testSsbo< sdw::Mat4 >( testCounts ); - testSsbo< sdw::Mat4x2 >( testCounts ); - testSsbo< sdw::Mat4x3 >( testCounts ); - testSsbo< sdw::DMat2 >( testCounts ); - testSsbo< sdw::DMat2x3 >( testCounts ); - testSsbo< sdw::DMat2x4 >( testCounts ); - testSsbo< sdw::DMat3 >( testCounts ); - testSsbo< sdw::DMat3x2 >( testCounts ); - testSsbo< sdw::DMat3x4 >( testCounts ); - testSsbo< sdw::DMat4 >( testCounts ); - testSsbo< sdw::DMat4x2 >( testCounts ); - testSsbo< sdw::DMat4x3 >( testCounts ); + testSsbo< sdw::SDW_TestType >( testCounts ); sdwTestSuiteEnd(); } -sdwTestSuiteLaunch( TestWriterSsboDeclarations ) +sdwTestSuiteLaunch( testName ) diff --git a/test/ShaderWriter/TestWriterStorageImageAccesses.cpp b/test/ShaderWriter/TestWriterStorageImageAccesses.cpp index 8ab3b775..e7d21573 100644 --- a/test/ShaderWriter/TestWriterStorageImageAccesses.cpp +++ b/test/ShaderWriter/TestWriterStorageImageAccesses.cpp @@ -858,92 +858,28 @@ namespace template< template< ast::type::ImageFormat, ast::type::AccessKind, ast::type::ImageDim, bool, bool > typename TesterT > void testsImage( test::sdw_test::TestCounts & testCounts ) { - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRgba32f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRgba16f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRg32f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRg16f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eR32f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eR16f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRgba32i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRgba16i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRgba8i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRg32i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRg16i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRg8i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eR32i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eR16i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eR8i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRgba32u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRgba16u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRgba8u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRg32u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRg16u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eRg8u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eR32u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eR16u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::eR8u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRgba32f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRgba16f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRg32f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRg16f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eR32f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eR16f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRgba32i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRgba16i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRgba8i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRg32i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRg16i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRg8i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eR32i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eR16i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eR8i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRgba32u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRgba16u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRgba8u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRg32u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRg16u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eRg8u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eR32u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eR16u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::eR8u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRgba32f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRgba16f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRg32f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRg16f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eR32f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eR16f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRgba32i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRgba16i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRgba8i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRg32i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRg16i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRg8i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eR32i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eR16i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eR8i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRgba32u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRgba16u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRgba8u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRg32u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRg16u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eRg8u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eR32u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eR16u, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eR8u, TesterT >( testCounts ); + testsImageFormats< ast::type::AccessKind::eRead, ast::type::ImageFormat::SDW_TestImageFormat, TesterT >( testCounts ); + testsImageFormats< ast::type::AccessKind::eWrite, ast::type::ImageFormat::SDW_TestImageFormat, TesterT >( testCounts ); + testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::SDW_TestImageFormat, TesterT >( testCounts ); } - template< template< ast::type::ImageFormat, ast::type::AccessKind, ast::type::ImageDim, bool, bool > typename TesterT > + template< ast::type::ImageFormat FormatT, template< ast::type::ImageFormat, ast::type::AccessKind, ast::type::ImageDim, bool, bool > typename TesterT > void testsImageAtomic( test::sdw_test::TestCounts & testCounts ) { - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eR32f, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eR32i, TesterT >( testCounts ); - testsImageFormats< ast::type::AccessKind::eReadWrite, ast::type::ImageFormat::eR32u, TesterT >( testCounts ); + if constexpr ( FormatT == ast::type::ImageFormat::eR32f + || FormatT == ast::type::ImageFormat::eR32i + || FormatT == ast::type::ImageFormat::eR32u ) + { + testsImageFormats< ast::type::AccessKind::eReadWrite, FormatT, TesterT >( testCounts ); + } } } #endif -sdwTestSuiteMain( TestWriterStorageImageAccesses ) +#define testName testConcat( TestWriterStorageImageAccesses, SDW_TestImageFormat ) + +sdwTestSuiteMain( testName ) { sdwTestSuiteBegin(); #if !defined( __APPLE__ ) @@ -952,17 +888,17 @@ sdwTestSuiteMain( TestWriterStorageImageAccesses ) testsImage< ImageSamplesTester >( testCounts ); testsImage< ImageLoadTester >( testCounts ); testsImage< ImageStoreTester >( testCounts ); - testsImageAtomic< ImageAtomicAddTester >( testCounts ); - testsImageAtomic< ImageAtomicMinTester >( testCounts ); - testsImageAtomic< ImageAtomicMaxTester >( testCounts ); - testsImageAtomic< ImageAtomicAndTester >( testCounts ); - testsImageAtomic< ImageAtomicOrTester >( testCounts ); - testsImageAtomic< ImageAtomicXorTester >( testCounts ); - testsImageAtomic< ImageAtomicExchangeTester >( testCounts ); - testsImageAtomic< ImageAtomicCompSwapTester >( testCounts ); + testsImageAtomic< ast::type::ImageFormat::SDW_TestImageFormat, ImageAtomicAddTester >( testCounts ); + testsImageAtomic< ast::type::ImageFormat::SDW_TestImageFormat, ImageAtomicMinTester >( testCounts ); + testsImageAtomic< ast::type::ImageFormat::SDW_TestImageFormat, ImageAtomicMaxTester >( testCounts ); + testsImageAtomic< ast::type::ImageFormat::SDW_TestImageFormat, ImageAtomicAndTester >( testCounts ); + testsImageAtomic< ast::type::ImageFormat::SDW_TestImageFormat, ImageAtomicOrTester >( testCounts ); + testsImageAtomic< ast::type::ImageFormat::SDW_TestImageFormat, ImageAtomicXorTester >( testCounts ); + testsImageAtomic< ast::type::ImageFormat::SDW_TestImageFormat, ImageAtomicExchangeTester >( testCounts ); + testsImageAtomic< ast::type::ImageFormat::SDW_TestImageFormat, ImageAtomicCompSwapTester >( testCounts ); #endif sdwTestSuiteEnd(); } -sdwTestSuiteLaunch( TestWriterStorageImageAccesses ) +sdwTestSuiteLaunch( testName ) diff --git a/test/ShaderWriter/TestWriterStorageImageDeclarations.cpp b/test/ShaderWriter/TestWriterStorageImageDeclarations.cpp index 52a65bf4..ae35265f 100644 --- a/test/ShaderWriter/TestWriterStorageImageDeclarations.cpp +++ b/test/ShaderWriter/TestWriterStorageImageDeclarations.cpp @@ -344,30 +344,7 @@ namespace sdwTestSuiteMain( TestWriterStorageImageDeclarations ) { sdwTestSuiteBegin(); - testImageFormat< ast::type::ImageFormat::eRgba32f >( testCounts ); - testImageFormat< ast::type::ImageFormat::eRgba16f >( testCounts ); - testImageFormat< ast::type::ImageFormat::eRg32f >( testCounts ); - testImageFormat< ast::type::ImageFormat::eRg16f >( testCounts ); - testImageFormat< ast::type::ImageFormat::eR32f >( testCounts ); - testImageFormat< ast::type::ImageFormat::eR16f >( testCounts ); - testImageFormat< ast::type::ImageFormat::eRgba32i >( testCounts ); - testImageFormat< ast::type::ImageFormat::eRgba16i >( testCounts ); - testImageFormat< ast::type::ImageFormat::eRgba8i >( testCounts ); - testImageFormat< ast::type::ImageFormat::eRg32i >( testCounts ); - testImageFormat< ast::type::ImageFormat::eRg16i >( testCounts ); - testImageFormat< ast::type::ImageFormat::eRg8i >( testCounts ); - testImageFormat< ast::type::ImageFormat::eR32i >( testCounts ); - testImageFormat< ast::type::ImageFormat::eR16i >( testCounts ); - testImageFormat< ast::type::ImageFormat::eR8i >( testCounts ); - testImageFormat< ast::type::ImageFormat::eRgba32u >( testCounts ); - testImageFormat< ast::type::ImageFormat::eRgba16u >( testCounts ); - testImageFormat< ast::type::ImageFormat::eRgba8u >( testCounts ); - testImageFormat< ast::type::ImageFormat::eRg32u >( testCounts ); - testImageFormat< ast::type::ImageFormat::eRg16u >( testCounts ); - testImageFormat< ast::type::ImageFormat::eRg8u >( testCounts ); - testImageFormat< ast::type::ImageFormat::eR32u >( testCounts ); - testImageFormat< ast::type::ImageFormat::eR16u >( testCounts ); - testImageFormat< ast::type::ImageFormat::eR8u >( testCounts ); + testImageFormat< ast::type::ImageFormat::SDW_TestImageFormat >( testCounts ); sdwTestSuiteEnd(); } diff --git a/test/ShaderWriter/TestWriterStructDeclarations.cpp b/test/ShaderWriter/TestWriterStructDeclarations.cpp index 3f506d78..798719a4 100644 --- a/test/ShaderWriter/TestWriterStructDeclarations.cpp +++ b/test/ShaderWriter/TestWriterStructDeclarations.cpp @@ -54,44 +54,13 @@ namespace } } -sdwTestSuiteMain( TestWriterStructDeclarations ) +#define testName testConcat( TestWriterStructDeclarations, SDW_TestType ) + +sdwTestSuiteMain( testName ) { sdwTestSuiteBegin(); - testStruct< sdw::Int >( testCounts ); - testStruct< sdw::UInt >( testCounts ); - testStruct< sdw::Float >( testCounts ); - testStruct< sdw::Double >( testCounts ); - testStruct< sdw::Vec2 >( testCounts ); - testStruct< sdw::Vec3 >( testCounts ); - testStruct< sdw::Vec4 >( testCounts ); - testStruct< sdw::DVec2 >( testCounts ); - testStruct< sdw::DVec3 >( testCounts ); - testStruct< sdw::DVec4 >( testCounts ); - testStruct< sdw::IVec2 >( testCounts ); - testStruct< sdw::IVec3 >( testCounts ); - testStruct< sdw::IVec4 >( testCounts ); - testStruct< sdw::UVec2 >( testCounts ); - testStruct< sdw::UVec3 >( testCounts ); - testStruct< sdw::UVec4 >( testCounts ); - testStruct< sdw::Mat2 >( testCounts ); - testStruct< sdw::Mat2x3 >( testCounts ); - testStruct< sdw::Mat2x4 >( testCounts ); - testStruct< sdw::Mat3 >( testCounts ); - testStruct< sdw::Mat3x2 >( testCounts ); - testStruct< sdw::Mat3x4 >( testCounts ); - testStruct< sdw::Mat4 >( testCounts ); - testStruct< sdw::Mat4x2 >( testCounts ); - testStruct< sdw::Mat4x3 >( testCounts ); - testStruct< sdw::DMat2 >( testCounts ); - testStruct< sdw::DMat2x3 >( testCounts ); - testStruct< sdw::DMat2x4 >( testCounts ); - testStruct< sdw::DMat3 >( testCounts ); - testStruct< sdw::DMat3x2 >( testCounts ); - testStruct< sdw::DMat3x4 >( testCounts ); - testStruct< sdw::DMat4 >( testCounts ); - testStruct< sdw::DMat4x2 >( testCounts ); - testStruct< sdw::DMat4x3 >( testCounts ); + testStruct< sdw::SDW_TestType >( testCounts ); sdwTestSuiteEnd(); } -sdwTestSuiteLaunch( TestWriterStructDeclarations ) +sdwTestSuiteLaunch( testName ) diff --git a/test/ShaderWriter/TestWriterUboDeclarations.cpp b/test/ShaderWriter/TestWriterUboDeclarations.cpp index 8b0f204b..1f16acb5 100644 --- a/test/ShaderWriter/TestWriterUboDeclarations.cpp +++ b/test/ShaderWriter/TestWriterUboDeclarations.cpp @@ -432,44 +432,13 @@ namespace } } -sdwTestSuiteMain( TestWriterUboDeclarations ) +#define testName testConcat( TestWriterUboDeclarations, SDW_TestType ) + +sdwTestSuiteMain( testName ) { sdwTestSuiteBegin(); - testUbo< sdw::Int >( testCounts ); - testUbo< sdw::UInt >( testCounts ); - testUbo< sdw::Float >( testCounts ); - testUbo< sdw::Double >( testCounts ); - testUbo< sdw::Vec2 >( testCounts ); - testUbo< sdw::Vec3 >( testCounts ); - testUbo< sdw::Vec4 >( testCounts ); - testUbo< sdw::DVec2 >( testCounts ); - testUbo< sdw::DVec3 >( testCounts ); - testUbo< sdw::DVec4 >( testCounts ); - testUbo< sdw::IVec2 >( testCounts ); - testUbo< sdw::IVec3 >( testCounts ); - testUbo< sdw::IVec4 >( testCounts ); - testUbo< sdw::UVec2 >( testCounts ); - testUbo< sdw::UVec3 >( testCounts ); - testUbo< sdw::UVec4 >( testCounts ); - testUbo< sdw::Mat2 >( testCounts ); - testUbo< sdw::Mat2x3 >( testCounts ); - testUbo< sdw::Mat2x4 >( testCounts ); - testUbo< sdw::Mat3 >( testCounts ); - testUbo< sdw::Mat3x2 >( testCounts ); - testUbo< sdw::Mat3x4 >( testCounts ); - testUbo< sdw::Mat4 >( testCounts ); - testUbo< sdw::Mat4x2 >( testCounts ); - testUbo< sdw::Mat4x3 >( testCounts ); - testUbo< sdw::DMat2 >( testCounts ); - testUbo< sdw::DMat2x3 >( testCounts ); - testUbo< sdw::DMat2x4 >( testCounts ); - testUbo< sdw::DMat3 >( testCounts ); - testUbo< sdw::DMat3x2 >( testCounts ); - testUbo< sdw::DMat3x4 >( testCounts ); - testUbo< sdw::DMat4 >( testCounts ); - testUbo< sdw::DMat4x2 >( testCounts ); - testUbo< sdw::DMat4x3 >( testCounts ); + testUbo< sdw::SDW_TestType >( testCounts ); sdwTestSuiteEnd(); } -sdwTestSuiteLaunch( TestWriterUboDeclarations ) +sdwTestSuiteLaunch( testName ) diff --git a/test/ShaderWriter/WriterCommon.hpp b/test/ShaderWriter/WriterCommon.hpp index 3a59b20f..188b9e9b 100644 --- a/test/ShaderWriter/WriterCommon.hpp +++ b/test/ShaderWriter/WriterCommon.hpp @@ -455,8 +455,8 @@ namespace test , sdw_test::TestCounts & testCounts ); } -#define sdwTestSuiteMain( testName )\ - static test::TestResults launch##testName( test::sdw_test::TestSuite & suite, test::sdw_test::TestCounts & testCounts ) +# define sdwTestSuiteMain( testName )\ + static test::TestResults testConcat2( launch, testName )( test::sdw_test::TestSuite & suite, test::sdw_test::TestCounts & testCounts ) #define sdwTestSuiteBegin()\ testSuiteBeginEx( testCounts )