Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6638c87
Enable testing for existing google tests; skip shader compiler tests …
filipppavlov Aug 31, 2026
fc55cb8
Formatting
filipppavlov Aug 31, 2026
8794289
Address PR comments; add prefixes to tests
filipppavlov Aug 31, 2026
cd4fc5c
Clean cmake files; skip ray-tracing tests if the device does not supp…
filipppavlov Aug 31, 2026
07bc7ab
Add Python tests to trinity
filipppavlov Sep 2, 2026
6f42b25
Fixed a test; formatting
filipppavlov Sep 2, 2026
2b18985
Add explicit dependency on the touched header
filipppavlov Sep 2, 2026
86b3aa0
Try a different way of specifying dependency on trinity: add_dependen…
filipppavlov Sep 2, 2026
d47c4e6
Set 30min timeout on running tests in case on of the tests causes a f…
filipppavlov Sep 2, 2026
aa34f57
Copy exefile and dependencies into a per-platform directory to avoid …
filipppavlov Sep 3, 2026
1777b0a
Fix a few issues with configuring; allow trinity's build flavor to di…
filipppavlov Sep 3, 2026
023a6b0
Fix building/running tests on macOS
filipppavlov Sep 4, 2026
cac46fd
Don't match "" build
filipppavlov Sep 4, 2026
ce45a29
Delay test discovery to work around add_dependencies issue with Ninja…
filipppavlov Sep 4, 2026
7effea1
Disable Python tests on x64 macOS. Delay test discovery to "pre test"…
filipppavlov Sep 7, 2026
16b08c8
Increase test discovery timeout for very slow agents; re-enable tests…
filipppavlov Sep 7, 2026
bbf3971
Don't create __pycache__ directories; remove redundant test
filipppavlov Sep 8, 2026
5fb3443
Merge from main
filipppavlov Sep 18, 2026
8f8508b
Merge branch 'tests' of https://github.com/carbonengine/trinity into …
filipppavlov Sep 18, 2026
018eb2e
Updated modular ship tests
filipppavlov Sep 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .teamcity/MacOS/Project.kt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class CarbonBuildMacOS(buildName: String, configType: String, preset: String, ag
name = "Run Tests"
workingDir = "%env.CMAKE_BUILD_FOLDER%"
path = "ctest"
arguments = "-C %env.CMAKE_CONFIG_TYPE% -V --output-on-failure --output-junit %env.CTEST_JUNIT_OUTPUT_FILE%"
arguments = "-C %env.CMAKE_CONFIG_TYPE% -V --output-on-failure --timeout 30 --output-junit %env.CTEST_JUNIT_OUTPUT_FILE%"
}
exec {
name = "Package artifact"
Expand Down
2 changes: 1 addition & 1 deletion .teamcity/Windows/Project.kt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class CarbonBuildWindows(buildName: String, configType: String, preset: String,
name = "Run Tests"
workingDir = "%env.CMAKE_BUILD_FOLDER%"
path = "ctest"
arguments = "-C %env.CMAKE_CONFIG_TYPE% -V --output-on-failure --output-junit %env.CTEST_JUNIT_OUTPUT_FILE%"
arguments = "-C %env.CMAKE_CONFIG_TYPE% -V --output-on-failure --timeout 30 --output-junit %env.CTEST_JUNIT_OUTPUT_FILE%"
}
exec {
name = "Package artifact"
Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if(BUILD_FOR_PYTHON_2)
set(BUILD_METAL ON)
set(BUILD_SHADER_COMPILER ON)
set(INSTALL_TO_MONOLITH ON)
set(BUILD_TESTING OFF)

else()
# Feature options
Expand Down Expand Up @@ -50,6 +51,14 @@ endif()

project(carbon-trinity VERSION 1.0.0)

if(PROJECT_IS_TOP_LEVEL)
option(BUILD_TESTING "Build tests. Enabled by default." ON)
endif()

if(BUILD_TESTING)
enable_testing()
endif()

if (BUILD_FOR_PYTHON_2)
if(NOT DEFINED ENV{CCP_EVE_PERFORCE_BRANCH_PATH})
message(FATAL_ERROR "Missing required environment variable CCP_EVE_PERFORCE_BRANCH_PATH")
Expand Down
7 changes: 3 additions & 4 deletions shadercompiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -306,18 +306,17 @@ else() # VCPKG install mode

endif()

option(BUILD_TESTING "Build and run tests. Enabled by default." ON)
message(STATUS " BUILD_TESTING VALUE IS ${BUILD_TESTING}")
if(BUILD_TESTING)

find_package(GTest REQUIRED)

add_executable(ShaderCompilerTest)
target_compile_definitions(ShaderCompilerTest PRIVATE SHADER_COMPILER_TEST=1)
target_link_libraries(ShaderCompilerTest PRIVATE GTest::GTest GTest::Main)
target_link_libraries(ShaderCompilerTest PRIVATE GTest::GTest)
target_sources(ShaderCompilerTest PRIVATE ${_TEST_SOURCES})
source_group(Tests FILES ${_TEST_SOURCES})
configure_shader_compiler(ShaderCompilerTest)
set_target_properties(ShaderCompilerTest PROPERTIES FOLDER "Tests")
add_dependencies(ShaderCompilerTest ShaderCompiler)

gtest_discover_tests(ShaderCompilerTest DISCOVERY_MODE PRE_TEST TEST_PREFIX ShaderCompiler.)
endif()
2 changes: 1 addition & 1 deletion shadercompiler/EffectCompilerMetal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4254,7 +4254,7 @@ std::string MetalTool( const char* name )
size_t programFilesSize;
getenv_s( &programFilesSize, programFiles, "PROGRAMFILES" );

cmd << "\"" << programFiles << "\\Metal Developer Tools\\metal\\macos\\bin\\" << name << ".exe\"";
cmd << "\"" << std::string( programFiles ) << "\\Metal Developer Tools\\metal\\macos\\bin\\" << name << ".exe\"";
}
#else
cmd << "xcrun -sdk macosx " << name;
Expand Down
73 changes: 73 additions & 0 deletions shadercompiler/tests/MetalConversionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

TEST( MetalConversion, TextureIndexingWorks )
{
if( !g_metalCompilerAvailable )
{
GTEST_SKIP() << "Skipping test: Metal compiler is not available.";
}

const char* src = R"SRC(
Texture2D<float3> tex;

Expand Down Expand Up @@ -38,6 +43,10 @@ technique t0

TEST( MetalConversion, AppliesPackedModifiersToCBuffers )
{
if( !g_metalCompilerAvailable )
{
GTEST_SKIP() << "Skipping test: Metal compiler is not available.";
}
const char* src = R"SRC(
cbuffer cb0: register( b3 )
{
Expand Down Expand Up @@ -72,6 +81,10 @@ technique t0

TEST( MetalConversion, AddsRowsToMatrixInitializers )
{
if( !g_metalCompilerAvailable )
{
GTEST_SKIP() << "Skipping test: Metal compiler is not available.";
}
const char* src = R"SRC(
float4 vs(): SV_Position
{
Expand Down Expand Up @@ -105,6 +118,12 @@ technique t0

TEST( MetalConversion, AppliesPackedModifiersToRtLocalBuffers )
{
if( !g_metalCompilerAvailable )
{
GTEST_SKIP() << "Skipping test: Metal compiler is not available.";
}


const char* src = R"SRC(
struct HitInfo
{
Expand Down Expand Up @@ -140,6 +159,11 @@ technique t0

TEST( MetalConversion, AllowBindlessResources )
{
if( !g_metalCompilerAvailable )
{
GTEST_SKIP() << "Skipping test: Metal compiler is not available.";
}

const char* src = R"SRC(

Buffer<float4> HeapView_BufferFloat4[]
Expand Down Expand Up @@ -186,6 +210,10 @@ technique t0

TEST( MetalConversion, AllowLocalBufferVars )
{
if( !g_metalCompilerAvailable )
{
GTEST_SKIP() << "Skipping test: Metal compiler is not available.";
}
const char* src = R"SRC(

Buffer<float4> HeapView_BufferFloat4[]
Expand Down Expand Up @@ -229,6 +257,11 @@ technique t0

TEST( MetalConversion, AllowManySrvsUavs )
{
if( !g_metalCompilerAvailable )
{
GTEST_SKIP() << "Skipping test: Metal compiler is not available.";
}

const char* src = R"SRC(

RWTexture2D<float4> Tex0;
Expand Down Expand Up @@ -338,6 +371,11 @@ technique t0

TEST( MetalShaderPatching, CanHaveVertexID )
{
if( !g_metalCompilerAvailable )
{
GTEST_SKIP() << "Skipping test: Metal compiler is not available.";
}

const char* src = R"SRC(

struct VSIn
Expand Down Expand Up @@ -381,6 +419,11 @@ technique t0

TEST( MetalShaderPatching, CanHaveVertexIDWithIAInputs )
{
if( !g_metalCompilerAvailable )
{
GTEST_SKIP() << "Skipping test: Metal compiler is not available.";
}

const char* src = R"SRC(

struct VSIn
Expand Down Expand Up @@ -425,6 +468,11 @@ technique t0

TEST( MetalShaderPatching, CanHaveNestedStructs )
{
if( !g_metalCompilerAvailable )
{
GTEST_SKIP() << "Skipping test: Metal compiler is not available.";
}

const char* src = R"SRC(

struct VSIn
Expand Down Expand Up @@ -472,6 +520,11 @@ technique t0

TEST( MetalShaderPatching, CanHaveNestedStructsWithSystemSemanticsWithIAInputs1 )
{
if( !g_metalCompilerAvailable )
{
GTEST_SKIP() << "Skipping test: Metal compiler is not available.";
}

const char* src = R"SRC(

struct VSIn
Expand Down Expand Up @@ -522,6 +575,11 @@ technique t0

TEST( MetalShaderPatching, CanHaveNestedStructsWithSystemSemanticsWithIAInputs2 )
{
if( !g_metalCompilerAvailable )
{
GTEST_SKIP() << "Skipping test: Metal compiler is not available.";
}

const char* src = R"SRC(

struct VSIn
Expand Down Expand Up @@ -572,6 +630,11 @@ technique t0

TEST( MetalShaderPatching, CanHaveInstanceID )
{
if( !g_metalCompilerAvailable )
{
GTEST_SKIP() << "Skipping test: Metal compiler is not available.";
}

const char* src = R"SRC(

struct VSIn
Expand Down Expand Up @@ -615,6 +678,11 @@ technique t0

TEST( MetalShaderPatching, CanHaveInstanceIDWithIAInputs )
{
if( !g_metalCompilerAvailable )
{
GTEST_SKIP() << "Skipping test: Metal compiler is not available.";
}

const char* src = R"SRC(

struct VSIn
Expand Down Expand Up @@ -659,6 +727,11 @@ technique t0

TEST( MetalShaderPatching, CanHaveSystemSemanticMixedParameterAndIAInputs )
{
if( !g_metalCompilerAvailable )
{
GTEST_SKIP() << "Skipping test: Metal compiler is not available.";
}

const char* src = R"SRC(

struct VSIn
Expand Down
Loading
Loading