diff --git a/SystemTools.cxx b/SystemTools.cxx
index 935b836cb02f64a17564a265000d60d5293b56da..2ec930205645e16842b376462ae329b3412f78c7 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -4869,7 +4869,8 @@ static int SystemToolsDebugReport(int, char* message, int*)
 
 void SystemTools::EnableMSVCDebugHook()
 {
-  if (getenv("DART_TEST_FROM_DART"))
+  if (getenv("DART_TEST_FROM_DART") ||
+      getenv("DASHBOARD_TEST_FROM_CTEST"))
     {
     _CrtSetReportHook(SystemToolsDebugReport);
     }