diff --git a/cmake/LYTestWrappers.cmake b/cmake/LYTestWrappers.cmake
index 535f00f58d..efb19a20dd 100644
--- a/cmake/LYTestWrappers.cmake
+++ b/cmake/LYTestWrappers.cmake
@@ -219,8 +219,17 @@ function(ly_add_test)
VS_DEBUGGER_COMMAND_ARGUMENTS "${test_arguments_line}"
)
+ # In the case where we are creating a custom target, we need to add dependency to the target
+ if(ly_add_test_PARENT_NAME AND NOT ${ly_add_test_NAME} STREQUAL ${ly_add_test_PARENT_NAME})
+ ly_add_dependencies(${unaliased_test_name} ${ly_add_test_PARENT_NAME})
+ endif()
+
endif()
+ # For test projects that are custom targets, pass a props file that sets the project as "Console" so
+ # it leaves the console open when it finishes
+ set_target_properties(${unaliased_test_name} PROPERTIES VS_USER_PROPS "${LY_ROOT_FOLDER}/cmake/Platform/Common/TestProject.props")
+
# Include additional dependencies
if (ly_add_test_RUNTIME_DEPENDENCIES)
ly_add_dependencies(${unaliased_test_name} ${ly_add_test_RUNTIME_DEPENDENCIES})
diff --git a/cmake/Platform/Common/Directory.Build.props b/cmake/Platform/Common/Directory.Build.props
index 73aa984073..76e4b28922 100644
--- a/cmake/Platform/Common/Directory.Build.props
+++ b/cmake/Platform/Common/Directory.Build.props
@@ -17,7 +17,12 @@ SPDX-License-Identifier: Apache-2.0 OR MIT
- TurnOffAllWarnings
+
+ TurnOffAllWarnings
+
+
\ No newline at end of file
diff --git a/cmake/Platform/Common/TestProject.props b/cmake/Platform/Common/TestProject.props
new file mode 100644
index 0000000000..dff509b7ff
--- /dev/null
+++ b/cmake/Platform/Common/TestProject.props
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+ Console
+
+
+