Browse Source

Fixes compilation if test modules are disabled. (#18786)

If you try to compile with LY_DISABLE_TEST_MODULES=ON,
the test coverage system (related to the Test Impact
Analysis Framework) will not define any symbols, and
the PythonCoverageEditorSystemComponent.cpp will
fail to compile due to a missing define.

Signed-off-by: Nicholas Lawson <[email protected]>
Nicholas Lawson 3 tháng trước cách đây
mục cha
commit
5855f6b946

+ 3 - 0
AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorSystemComponent.cpp

@@ -71,6 +71,8 @@ namespace PythonCoverage
     PythonCoverageEditorSystemComponent::CoverageState PythonCoverageEditorSystemComponent::ParseCoverageOutputDirectory()
     {
         m_coverageState = CoverageState::Disabled;
+
+#if defined(LY_TEST_IMPACT_DEFAULT_CONFIG_FILE)
         const AZStd::string configFilePath = LY_TEST_IMPACT_DEFAULT_CONFIG_FILE;
 
         if (configFilePath.empty())
@@ -106,6 +108,7 @@ namespace PythonCoverage
 
         // Everything is good to go, await the first python test case
         m_coverageState = CoverageState::Idle;
+#endif
         return m_coverageState;
     }