|  | @@ -305,6 +305,9 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml)
 | 
	
		
			
				|  |  |      case cmCTestMemCheckHandler::ADDRESS_SANITIZER:
 | 
	
		
			
				|  |  |        xml.Attribute("Checker", "AddressSanitizer");
 | 
	
		
			
				|  |  |        break;
 | 
	
		
			
				|  |  | +    case cmCTestMemCheckHandler::LEAK_SANITIZER:
 | 
	
		
			
				|  |  | +      xml.Attribute("Checker", "LeakSanitizer");
 | 
	
		
			
				|  |  | +      break;
 | 
	
		
			
				|  |  |      case cmCTestMemCheckHandler::THREAD_SANITIZER:
 | 
	
		
			
				|  |  |        xml.Attribute("Checker", "ThreadSanitizer");
 | 
	
		
			
				|  |  |        break;
 | 
	
	
		
			
				|  | @@ -458,6 +461,12 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
 | 
	
		
			
				|  |  |      this->MemoryTesterStyle = cmCTestMemCheckHandler::ADDRESS_SANITIZER;
 | 
	
		
			
				|  |  |      this->LogWithPID = true; // even if we give the log file the pid is added
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | +  if (this->CTest->GetCTestConfiguration("MemoryCheckType") ==
 | 
	
		
			
				|  |  | +      "LeakSanitizer") {
 | 
	
		
			
				|  |  | +    this->MemoryTester = this->CTest->GetCTestConfiguration("CMakeCommand");
 | 
	
		
			
				|  |  | +    this->MemoryTesterStyle = cmCTestMemCheckHandler::LEAK_SANITIZER;
 | 
	
		
			
				|  |  | +    this->LogWithPID = true; // even if we give the log file the pid is added
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  |    if (this->CTest->GetCTestConfiguration("MemoryCheckType") ==
 | 
	
		
			
				|  |  |        "ThreadSanitizer") {
 | 
	
		
			
				|  |  |      this->MemoryTester = this->CTest->GetCTestConfiguration("CMakeCommand");
 | 
	
	
		
			
				|  | @@ -586,6 +595,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      // these are almost the same but the env var used is different
 | 
	
		
			
				|  |  |      case cmCTestMemCheckHandler::ADDRESS_SANITIZER:
 | 
	
		
			
				|  |  | +    case cmCTestMemCheckHandler::LEAK_SANITIZER:
 | 
	
		
			
				|  |  |      case cmCTestMemCheckHandler::THREAD_SANITIZER:
 | 
	
		
			
				|  |  |      case cmCTestMemCheckHandler::MEMORY_SANITIZER:
 | 
	
		
			
				|  |  |      case cmCTestMemCheckHandler::UB_SANITIZER: {
 | 
	
	
		
			
				|  | @@ -603,6 +613,9 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
 | 
	
		
			
				|  |  |            cmCTestMemCheckHandler::ADDRESS_SANITIZER) {
 | 
	
		
			
				|  |  |          envVar = "ASAN_OPTIONS";
 | 
	
		
			
				|  |  |          extraOptions += " detect_leaks=1";
 | 
	
		
			
				|  |  | +      } else if (this->MemoryTesterStyle ==
 | 
	
		
			
				|  |  | +                 cmCTestMemCheckHandler::LEAK_SANITIZER) {
 | 
	
		
			
				|  |  | +        envVar = "LSAN_OPTIONS";
 | 
	
		
			
				|  |  |        } else if (this->MemoryTesterStyle ==
 | 
	
		
			
				|  |  |                   cmCTestMemCheckHandler::THREAD_SANITIZER) {
 | 
	
		
			
				|  |  |          envVar = "TSAN_OPTIONS";
 | 
	
	
		
			
				|  | @@ -644,6 +657,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckOutput(const std::string& str,
 | 
	
		
			
				|  |  |      case cmCTestMemCheckHandler::PURIFY:
 | 
	
		
			
				|  |  |        return this->ProcessMemCheckPurifyOutput(str, log, results);
 | 
	
		
			
				|  |  |      case cmCTestMemCheckHandler::ADDRESS_SANITIZER:
 | 
	
		
			
				|  |  | +    case cmCTestMemCheckHandler::LEAK_SANITIZER:
 | 
	
		
			
				|  |  |      case cmCTestMemCheckHandler::THREAD_SANITIZER:
 | 
	
		
			
				|  |  |      case cmCTestMemCheckHandler::MEMORY_SANITIZER:
 | 
	
		
			
				|  |  |      case cmCTestMemCheckHandler::UB_SANITIZER:
 | 
	
	
		
			
				|  | @@ -680,6 +694,9 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput(
 | 
	
		
			
				|  |  |      case cmCTestMemCheckHandler::ADDRESS_SANITIZER:
 | 
	
		
			
				|  |  |        regex = "ERROR: AddressSanitizer: (.*) on.*";
 | 
	
		
			
				|  |  |        break;
 | 
	
		
			
				|  |  | +    case cmCTestMemCheckHandler::LEAK_SANITIZER:
 | 
	
		
			
				|  |  | +      // use leakWarning regex
 | 
	
		
			
				|  |  | +      break;
 | 
	
		
			
				|  |  |      case cmCTestMemCheckHandler::THREAD_SANITIZER:
 | 
	
		
			
				|  |  |        regex = "WARNING: ThreadSanitizer: (.*) \\(pid=.*\\)";
 | 
	
		
			
				|  |  |        break;
 |