mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 11:18:40 +08:00
CTest: Rename CudaMemcheck to CudaSanitizer
This commit is contained in:
@@ -1142,19 +1142,19 @@ Additional configuration settings include:
|
|||||||
* `CTest Script`_ variable: none
|
* `CTest Script`_ variable: none
|
||||||
* :module:`CTest` module variable: ``DRMEMORY_COMMAND_OPTIONS``
|
* :module:`CTest` module variable: ``DRMEMORY_COMMAND_OPTIONS``
|
||||||
|
|
||||||
``CudaMemcheckCommand``
|
``CudaSanitizerCommand``
|
||||||
Specify a ``MemoryCheckCommand`` that is known to be a command-line
|
Specify a ``MemoryCheckCommand`` that is known to be a command-line
|
||||||
compatible with cuda-memcheck or compute-sanitizer.
|
compatible with cuda-memcheck or compute-sanitizer.
|
||||||
|
|
||||||
* `CTest Script`_ variable: none
|
* `CTest Script`_ variable: none
|
||||||
* :module:`CTest` module variable: ``CUDA_MEMCHECK_COMMAND``
|
* :module:`CTest` module variable: ``CUDA_SANITIZER_COMMAND``
|
||||||
|
|
||||||
``CudaMemcheckCommandOptions``
|
``CudaSanitizerCommandOptions``
|
||||||
Specify command-line options to the ``CudaMemcheckCommand`` tool.
|
Specify command-line options to the ``CudaSanitizerCommand`` tool.
|
||||||
They will be placed prior to the test command line.
|
They will be placed prior to the test command line.
|
||||||
|
|
||||||
* `CTest Script`_ variable: none
|
* `CTest Script`_ variable: none
|
||||||
* :module:`CTest` module variable: ``CUDA_MEMCHECK_COMMAND_OPTIONS``
|
* :module:`CTest` module variable: ``CUDA_SANITIZER_COMMAND_OPTIONS``
|
||||||
|
|
||||||
.. _`CTest Submit Step`:
|
.. _`CTest Submit Step`:
|
||||||
|
|
||||||
|
@@ -6,5 +6,5 @@ CTEST_MEMORYCHECK_TYPE
|
|||||||
Specify the CTest ``MemoryCheckType`` setting
|
Specify the CTest ``MemoryCheckType`` setting
|
||||||
in a :manual:`ctest(1)` dashboard client script.
|
in a :manual:`ctest(1)` dashboard client script.
|
||||||
Valid values are ``Valgrind``, ``Purify``, ``BoundsChecker``, ``DrMemory``,
|
Valid values are ``Valgrind``, ``Purify``, ``BoundsChecker``, ``DrMemory``,
|
||||||
``CudaMemcheck``, ``ThreadSanitizer``, ``AddressSanitizer``, ``LeakSanitizer``,
|
``CudaSanitizer``, ``ThreadSanitizer``, ``AddressSanitizer``, ``LeakSanitizer``,
|
||||||
``MemorySanitizer`` and ``UndefinedBehaviorSanitizer``.
|
``MemorySanitizer`` and ``UndefinedBehaviorSanitizer``.
|
||||||
|
@@ -71,8 +71,8 @@ ValgrindCommand: @VALGRIND_COMMAND@
|
|||||||
ValgrindCommandOptions: @VALGRIND_COMMAND_OPTIONS@
|
ValgrindCommandOptions: @VALGRIND_COMMAND_OPTIONS@
|
||||||
DrMemoryCommand: @DRMEMORY_COMMAND@
|
DrMemoryCommand: @DRMEMORY_COMMAND@
|
||||||
DrMemoryCommandOptions: @DRMEMORY_COMMAND_OPTIONS@
|
DrMemoryCommandOptions: @DRMEMORY_COMMAND_OPTIONS@
|
||||||
CudaMemcheckCommand: @CUDA_MEMCHECK_COMMAND@
|
CudaSanitizerCommand: @CUDA_SANITIZER_COMMAND@
|
||||||
CudaMemcheckCommandOptions: @CUDA_MEMCHECK_COMMAND_OPTIONS@
|
CudaSanitizerCommandOptions: @CUDA_SANITIZER_COMMAND_OPTIONS@
|
||||||
MemoryCheckType: @MEMORYCHECK_TYPE@
|
MemoryCheckType: @MEMORYCHECK_TYPE@
|
||||||
MemoryCheckSanitizerOptions: @MEMORYCHECK_SANITIZER_OPTIONS@
|
MemoryCheckSanitizerOptions: @MEMORYCHECK_SANITIZER_OPTIONS@
|
||||||
MemoryCheckCommand: @MEMORYCHECK_COMMAND@
|
MemoryCheckCommand: @MEMORYCHECK_COMMAND@
|
||||||
|
@@ -326,8 +326,8 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml)
|
|||||||
case cmCTestMemCheckHandler::BOUNDS_CHECKER:
|
case cmCTestMemCheckHandler::BOUNDS_CHECKER:
|
||||||
xml.Attribute("Checker", "BoundsChecker");
|
xml.Attribute("Checker", "BoundsChecker");
|
||||||
break;
|
break;
|
||||||
case cmCTestMemCheckHandler::CUDA_MEMCHECK:
|
case cmCTestMemCheckHandler::CUDA_SANITIZER:
|
||||||
xml.Attribute("Checker", "CudaMemcheck");
|
xml.Attribute("Checker", "CudaSanitizer");
|
||||||
break;
|
break;
|
||||||
case cmCTestMemCheckHandler::ADDRESS_SANITIZER:
|
case cmCTestMemCheckHandler::ADDRESS_SANITIZER:
|
||||||
xml.Attribute("Checker", "AddressSanitizer");
|
xml.Attribute("Checker", "AddressSanitizer");
|
||||||
@@ -470,7 +470,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
|
|||||||
this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
|
this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
|
||||||
} else if (testerName.find("cuda-memcheck") != std::string::npos ||
|
} else if (testerName.find("cuda-memcheck") != std::string::npos ||
|
||||||
testerName.find("compute-sanitizer") != std::string::npos) {
|
testerName.find("compute-sanitizer") != std::string::npos) {
|
||||||
this->MemoryTesterStyle = cmCTestMemCheckHandler::CUDA_MEMCHECK;
|
this->MemoryTesterStyle = cmCTestMemCheckHandler::CUDA_SANITIZER;
|
||||||
} else {
|
} else {
|
||||||
this->MemoryTesterStyle = cmCTestMemCheckHandler::UNKNOWN;
|
this->MemoryTesterStyle = cmCTestMemCheckHandler::UNKNOWN;
|
||||||
}
|
}
|
||||||
@@ -492,10 +492,10 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
|
|||||||
this->CTest->GetCTestConfiguration("BoundsCheckerCommand");
|
this->CTest->GetCTestConfiguration("BoundsCheckerCommand");
|
||||||
this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
|
this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
|
||||||
} else if (cmSystemTools::FileExists(
|
} else if (cmSystemTools::FileExists(
|
||||||
this->CTest->GetCTestConfiguration("CudaMemcheckCommand"))) {
|
this->CTest->GetCTestConfiguration("CudaSanitizerCommand"))) {
|
||||||
this->MemoryTester =
|
this->MemoryTester =
|
||||||
this->CTest->GetCTestConfiguration("CudaMemcheckCommand");
|
this->CTest->GetCTestConfiguration("CudaSanitizerCommand");
|
||||||
this->MemoryTesterStyle = cmCTestMemCheckHandler::CUDA_MEMCHECK;
|
this->MemoryTesterStyle = cmCTestMemCheckHandler::CUDA_SANITIZER;
|
||||||
}
|
}
|
||||||
if (this->CTest->GetCTestConfiguration("MemoryCheckType") ==
|
if (this->CTest->GetCTestConfiguration("MemoryCheckType") ==
|
||||||
"AddressSanitizer") {
|
"AddressSanitizer") {
|
||||||
@@ -539,8 +539,8 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
|
|||||||
this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND;
|
this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND;
|
||||||
} else if (checkType == "DrMemory") {
|
} else if (checkType == "DrMemory") {
|
||||||
this->MemoryTesterStyle = cmCTestMemCheckHandler::DRMEMORY;
|
this->MemoryTesterStyle = cmCTestMemCheckHandler::DRMEMORY;
|
||||||
} else if (checkType == "CudaMemcheck") {
|
} else if (checkType == "CudaSanitizer") {
|
||||||
this->MemoryTesterStyle = cmCTestMemCheckHandler::CUDA_MEMCHECK;
|
this->MemoryTesterStyle = cmCTestMemCheckHandler::CUDA_SANITIZER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this->MemoryTester.empty()) {
|
if (this->MemoryTester.empty()) {
|
||||||
@@ -566,10 +566,10 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
|
|||||||
.empty()) {
|
.empty()) {
|
||||||
memoryTesterOptions =
|
memoryTesterOptions =
|
||||||
this->CTest->GetCTestConfiguration("DrMemoryCommandOptions");
|
this->CTest->GetCTestConfiguration("DrMemoryCommandOptions");
|
||||||
} else if (!this->CTest->GetCTestConfiguration("CudaMemcheckCommandOptions")
|
} else if (!this->CTest->GetCTestConfiguration("CudaSanitizerCommandOptions")
|
||||||
.empty()) {
|
.empty()) {
|
||||||
memoryTesterOptions =
|
memoryTesterOptions =
|
||||||
this->CTest->GetCTestConfiguration("CudaMemcheckCommandOptions");
|
this->CTest->GetCTestConfiguration("CudaSanitizerCommandOptions");
|
||||||
}
|
}
|
||||||
this->MemoryTesterOptions =
|
this->MemoryTesterOptions =
|
||||||
cmSystemTools::ParseArguments(memoryTesterOptions);
|
cmSystemTools::ParseArguments(memoryTesterOptions);
|
||||||
@@ -703,8 +703,8 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
|
|||||||
this->MemoryTesterOptions.emplace_back("/M");
|
this->MemoryTesterOptions.emplace_back("/M");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case cmCTestMemCheckHandler::CUDA_MEMCHECK: {
|
case cmCTestMemCheckHandler::CUDA_SANITIZER: {
|
||||||
// cuda-memcheck separates flags from arguments by spaces
|
// cuda sanitizer separates flags from arguments by spaces
|
||||||
if (this->MemoryTesterOptions.empty()) {
|
if (this->MemoryTesterOptions.empty()) {
|
||||||
this->MemoryTesterOptions.emplace_back("--tool");
|
this->MemoryTesterOptions.emplace_back("--tool");
|
||||||
this->MemoryTesterOptions.emplace_back("memcheck");
|
this->MemoryTesterOptions.emplace_back("memcheck");
|
||||||
@@ -800,7 +800,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckOutput(const std::string& str,
|
|||||||
return this->ProcessMemCheckSanitizerOutput(str, log, results);
|
return this->ProcessMemCheckSanitizerOutput(str, log, results);
|
||||||
case cmCTestMemCheckHandler::BOUNDS_CHECKER:
|
case cmCTestMemCheckHandler::BOUNDS_CHECKER:
|
||||||
return this->ProcessMemCheckBoundsCheckerOutput(str, log, results);
|
return this->ProcessMemCheckBoundsCheckerOutput(str, log, results);
|
||||||
case cmCTestMemCheckHandler::CUDA_MEMCHECK:
|
case cmCTestMemCheckHandler::CUDA_SANITIZER:
|
||||||
return this->ProcessMemCheckCudaOutput(str, log, results);
|
return this->ProcessMemCheckCudaOutput(str, log, results);
|
||||||
default:
|
default:
|
||||||
log.append("\nMemory checking style used was: ");
|
log.append("\nMemory checking style used was: ");
|
||||||
@@ -1188,7 +1188,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckCudaOutput(
|
|||||||
|
|
||||||
if (memcheckLine.find(lines[cc])) {
|
if (memcheckLine.find(lines[cc])) {
|
||||||
cmCTestOptionalLog(this->CTest, DEBUG,
|
cmCTestOptionalLog(this->CTest, DEBUG,
|
||||||
"cuda-memcheck line " << lines[cc] << std::endl,
|
"cuda sanitizer line " << lines[cc] << std::endl,
|
||||||
this->Quiet);
|
this->Quiet);
|
||||||
int failure = -1;
|
int failure = -1;
|
||||||
auto& line = lines[cc];
|
auto& line = lines[cc];
|
||||||
@@ -1219,7 +1219,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckCudaOutput(
|
|||||||
nonMemcheckOutput.push_back(cc);
|
nonMemcheckOutput.push_back(cc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Now put all all the non cuda-memcheck output into the test output
|
// Now put all all the non cuda sanitizer output into the test output
|
||||||
// This should be last in case it gets truncated by the output
|
// This should be last in case it gets truncated by the output
|
||||||
// limiting code
|
// limiting code
|
||||||
for (std::string::size_type i : nonMemcheckOutput) {
|
for (std::string::size_type i : nonMemcheckOutput) {
|
||||||
|
@@ -45,7 +45,7 @@ private:
|
|||||||
DRMEMORY,
|
DRMEMORY,
|
||||||
BOUNDS_CHECKER,
|
BOUNDS_CHECKER,
|
||||||
// checkers after here do not use the standard error list
|
// checkers after here do not use the standard error list
|
||||||
CUDA_MEMCHECK,
|
CUDA_SANITIZER,
|
||||||
ADDRESS_SANITIZER,
|
ADDRESS_SANITIZER,
|
||||||
LEAK_SANITIZER,
|
LEAK_SANITIZER,
|
||||||
THREAD_SANITIZER,
|
THREAD_SANITIZER,
|
||||||
|
@@ -167,7 +167,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
|
|||||||
-DPSEUDO_BC=$<TARGET_FILE:pseudo_BC>
|
-DPSEUDO_BC=$<TARGET_FILE:pseudo_BC>
|
||||||
-DPSEUDO_PURIFY=$<TARGET_FILE:pseudo_purify>
|
-DPSEUDO_PURIFY=$<TARGET_FILE:pseudo_purify>
|
||||||
-DPSEUDO_VALGRIND=$<TARGET_FILE:pseudo_valgrind>
|
-DPSEUDO_VALGRIND=$<TARGET_FILE:pseudo_valgrind>
|
||||||
-DPSEUDO_CUDA_MEMCHECK=$<TARGET_FILE:pseudo_cuda-memcheck>
|
-DPSEUDO_CUDA_SANITIZER=$<TARGET_FILE:pseudo_cuda-memcheck>
|
||||||
-DPSEUDO_BC_NOLOG=$<TARGET_FILE:pseudonl_BC>
|
-DPSEUDO_BC_NOLOG=$<TARGET_FILE:pseudonl_BC>
|
||||||
-DPSEUDO_PURIFY_NOLOG=$<TARGET_FILE:pseudonl_purify>
|
-DPSEUDO_PURIFY_NOLOG=$<TARGET_FILE:pseudonl_purify>
|
||||||
-DPSEUDO_VALGRIND_NOLOG=$<TARGET_FILE:pseudonl_valgrind>
|
-DPSEUDO_VALGRIND_NOLOG=$<TARGET_FILE:pseudonl_valgrind>
|
||||||
|
@@ -179,11 +179,11 @@ unset(CTEST_SUFFIX_CODE)
|
|||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
set(CMAKELISTS_EXTRA_CODE
|
set(CMAKELISTS_EXTRA_CODE
|
||||||
"add_test(NAME TestSan COMMAND \"${CMAKE_COMMAND}\"
|
"add_test(NAME TestSan COMMAND \"${CMAKE_COMMAND}\"
|
||||||
-P \"${RunCMake_SOURCE_DIR}/testCudaMemcheck.cmake\")
|
-P \"${RunCMake_SOURCE_DIR}/testCudaSanitizer.cmake\")
|
||||||
")
|
")
|
||||||
set(CTEST_SUFFIX_CODE "message(\"Defect count: \${defect_count}\")")
|
set(CTEST_SUFFIX_CODE "message(\"Defect count: \${defect_count}\")")
|
||||||
set(CTEST_MEMCHECK_ARGS "DEFECT_COUNT defect_count")
|
set(CTEST_MEMCHECK_ARGS "DEFECT_COUNT defect_count")
|
||||||
run_mc_test(DummyCudaMemcheck "${PSEUDO_CUDA_MEMCHECK}")
|
run_mc_test(DummyCudaSanitizer "${PSEUDO_CUDA_SANITIZER}")
|
||||||
unset(CTEST_MEMCHECK_ARGS)
|
unset(CTEST_MEMCHECK_ARGS)
|
||||||
unset(CTEST_SUFFIX_CODE)
|
unset(CTEST_SUFFIX_CODE)
|
||||||
unset(CTEST_EXTRA_CODE)
|
unset(CTEST_EXTRA_CODE)
|
||||||
|
Reference in New Issue
Block a user