2
0
Эх сурвалжийг харах

Add LY_TEST_IMPACT_ACTIVE variable and disable TIAF generation and tests if not set

Signed-off-by: Jack Curtis <[email protected]>
Jack Curtis 3 жил өмнө
parent
commit
0ebd5f998e

+ 17 - 17
Code/Tools/TestImpactFramework/CMakeLists.txt

@@ -10,23 +10,23 @@ o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O
 
 include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
 
-if(PAL_TRAIT_TEST_IMPACT_FRAMEWORK_SUPPORTED)
+if(PAL_TRAIT_TEST_IMPACT_FRAMEWORK_SUPPORTED AND LY_TEST_IMPACT_ACTIVE)
     add_subdirectory(Runtime)
     add_subdirectory(Frontend)
-    #ly_add_pytest(
-    #    NAME TiafToolsTest
-    #    PATH ${LY_ROOT_FOLDER}/scripts/build/TestImpactAnalysis/Testing/test_tiaf_tools.py
-    #    TEST_SERIAL
-    #    COMPONENT 
-    #        TestImpactFramework
-    #    
-    #)
-    #
-    #ly_add_pytest(
-    #    NAME TiafPythonUnitTest
-    #    PATH ${LY_ROOT_FOLDER}/scripts/build/TestImpactAnalysis/Testing/test_tiaf_unit_tests.py
-    #    TEST_SERIAL
-    #    COMPONENT
-    #        TestImpactFramework
-    #)
+    ly_add_pytest(
+        NAME TiafToolsTest
+        PATH ${LY_ROOT_FOLDER}/scripts/build/TestImpactAnalysis/Testing/test_tiaf_tools.py
+        TEST_SERIAL
+        COMPONENT 
+            TestImpactFramework
+        
+    )
+    
+    ly_add_pytest(
+        NAME TiafPythonUnitTest
+        PATH ${LY_ROOT_FOLDER}/scripts/build/TestImpactAnalysis/Testing/test_tiaf_unit_tests.py
+        TEST_SERIAL
+        COMPONENT
+            TestImpactFramework
+    )
 endif()

+ 7 - 1
cmake/TestImpactFramework/LYTestImpactFramework.cmake

@@ -63,6 +63,12 @@ set(LY_TEST_IMPACT_CONFIG_FILE_PATH_DEFINITION "LY_TEST_IMPACT_DEFAULT_CONFIG_FI
 # Path to file used to store data required by TIAF tests
 set(LY_TEST_IMPACT_PYTEST_FILE_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>")
 
+if(NOT LY_TEST_IMPACT_INSTRUMENTATION_BIN STREQUAL "")
+    set(LY_TEST_IMPACT_ACTIVE true)
+else()
+    set(LY_TEST_IMPACT_ACTIVE 0)
+endif()
+
 #! ly_test_impact_rebase_file_to_repo_root: rebases the relative and/or absolute path to be relative to repo root directory and places the resulting path in quotes.
 #
 # \arg:INPUT_FILE the file to rebase
@@ -540,7 +546,7 @@ endfunction()
 
 #! ly_test_impact_post_step: runs the post steps to be executed after all other cmake scripts have been executed.
 function(ly_test_impact_post_step)
-    if(NOT LY_TEST_IMPACT_INSTRUMENTATION_BIN)
+    if(NOT LY_TEST_IMPACT_ACTIVE)
         return()
     endif()