summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Auxiliary/vim/syntax/cmake.vim2
-rw-r--r--Help/command/ctest_memcheck.rst8
-rw-r--r--Help/command/target_link_libraries.rst5
-rw-r--r--Help/release/dev/ExternalProject-GIT_CONFIG.rst5
-rw-r--r--Help/release/dev/ctest_memcheck_defect_count.rst5
-rw-r--r--Help/release/dev/fuchsia-platform.rst4
-rw-r--r--Help/release/dev/vs_targets_file_as_library.rst6
-rw-r--r--Modules/Compiler/Intel-CXX-FeatureTests.cmake6
-rw-r--r--Modules/Compiler/Intel-CXX.cmake28
-rw-r--r--Modules/ExternalProject.cmake14
-rw-r--r--Modules/Platform/Fuchsia.cmake25
-rw-r--r--Modules/Platform/Windows.cmake1
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestHandlerCommand.cxx5
-rw-r--r--Source/CTest/cmCTestHandlerCommand.h2
-rw-r--r--Source/CTest/cmCTestMemCheckCommand.cxx20
-rw-r--r--Source/CTest/cmCTestMemCheckCommand.h10
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx15
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.h3
-rw-r--r--Source/CTest/cmCTestRunTest.cxx2
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx21
-rw-r--r--Source/cmCTest.cxx48
-rw-r--r--Source/cmCTest.h8
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx118
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h15
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt9
-rw-r--r--Tests/ExternalProject/CMakeLists.txt17
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/RunCTest.cmake1
-rw-r--r--Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-result.txt1
-rw-r--r--Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-stdout.txt3
-rw-r--r--Tests/RunCMake/ctest_memcheck/DummyValgrindNoDefects-result.txt1
-rw-r--r--Tests/RunCMake/ctest_memcheck/DummyValgrindNoDefects-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_memcheck/DummyValgrindNoDefects-stdout.txt6
-rw-r--r--Tests/RunCMake/ctest_memcheck/RunCMakeTest.cmake31
-rw-r--r--Tests/RunCMake/ctest_memcheck/test.cmake.in4
37 files changed, 348 insertions, 106 deletions
diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim
index 11b0fcb..fabf9c1 100644
--- a/Auxiliary/vim/syntax/cmake.vim
+++ b/Auxiliary/vim/syntax/cmake.vim
@@ -128,7 +128,7 @@ syn keyword cmakeKWctest_coverage
\ contained
syn keyword cmakeKWctest_memcheck
- \ APPEND BUILD END EXCLUDE EXCLUDE_LABEL INCLUDE INCLUDE_LABEL OFF ON PARALLEL_LEVEL QUIET RETURN_VALUE SCHEDULE_RANDOM START STOP_TIME STRIDE TEST_LOAD
+ \ APPEND BUILD DEFECT_COUNT END EXCLUDE EXCLUDE_LABEL INCLUDE INCLUDE_LABEL OFF ON PARALLEL_LEVEL QUIET RETURN_VALUE SCHEDULE_RANDOM START STOP_TIME STRIDE TEST_LOAD
\ contained
syn keyword cmakeKWctest_run_script
diff --git a/Help/command/ctest_memcheck.rst b/Help/command/ctest_memcheck.rst
index 29bdf7d..a983d68 100644
--- a/Help/command/ctest_memcheck.rst
+++ b/Help/command/ctest_memcheck.rst
@@ -18,6 +18,7 @@ Perform the :ref:`CTest MemCheck Step` as a :ref:`Dashboard Client`.
[SCHEDULE_RANDOM <ON|OFF>]
[STOP_TIME <time-of-day>]
[RETURN_VALUE <result-var>]
+ [DEFECT_COUNT <defect-count-var>]
[QUIET]
)
@@ -26,4 +27,9 @@ Run tests with a dynamic analysis tool and store results in
``MemCheck.xml`` for submission with the :command:`ctest_submit`
command.
-The options are the same as those for the :command:`ctest_test` command.
+Most options are the same as those for the :command:`ctest_test` command.
+
+The options unique to this command are:
+
+``DEFECT_COUNT <defect-count-var>``
+ Store in the ``<defect-count-var>`` the number of defects found.
diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst
index 90b6575..30d69f2 100644
--- a/Help/command/target_link_libraries.rst
+++ b/Help/command/target_link_libraries.rst
@@ -53,6 +53,11 @@ Each ``<item>`` may be:
:ref:`usage requirement <Target Usage Requirements>`. This has the same
effect as passing the framework directory as an include directory.
+ On :ref:`Visual Studio Generators` for VS 2010 and above, library files
+ ending in ``.targets`` will be treated as MSBuild targets files and
+ imported into generated project files. This is not supported by other
+ generators.
+
* **A plain library name**: The generated link line will ask the linker
to search for the library (e.g. ``foo`` becomes ``-lfoo`` or ``foo.lib``).
diff --git a/Help/release/dev/ExternalProject-GIT_CONFIG.rst b/Help/release/dev/ExternalProject-GIT_CONFIG.rst
new file mode 100644
index 0000000..2ab15e5
--- /dev/null
+++ b/Help/release/dev/ExternalProject-GIT_CONFIG.rst
@@ -0,0 +1,5 @@
+ExternalProject-GIT_CONFIG
+--------------------------
+
+* The :module:`ExternalProject` module gained a ``GIT_CONFIG`` option
+ to pass ``--config`` options to Git when cloning repositories.
diff --git a/Help/release/dev/ctest_memcheck_defect_count.rst b/Help/release/dev/ctest_memcheck_defect_count.rst
new file mode 100644
index 0000000..70061c1
--- /dev/null
+++ b/Help/release/dev/ctest_memcheck_defect_count.rst
@@ -0,0 +1,5 @@
+ctest_memcheck_defect_count
+---------------------------
+
+* The :command:`ctest_memcheck` command gained a ``DEFECT_COUNT <var>``
+ option to capture the number of memory defects detected.
diff --git a/Help/release/dev/fuchsia-platform.rst b/Help/release/dev/fuchsia-platform.rst
new file mode 100644
index 0000000..9d5f3e8
--- /dev/null
+++ b/Help/release/dev/fuchsia-platform.rst
@@ -0,0 +1,4 @@
+fuchsia-platform
+----------------
+
+* A new minimal platform file for Fuchsia was added.
diff --git a/Help/release/dev/vs_targets_file_as_library.rst b/Help/release/dev/vs_targets_file_as_library.rst
new file mode 100644
index 0000000..9c923fa
--- /dev/null
+++ b/Help/release/dev/vs_targets_file_as_library.rst
@@ -0,0 +1,6 @@
+vs_targets_file_as_library
+--------------------------
+
+* :ref:`Visual Studio Generators` learned to treat files passed to
+ :command:`target_link_libraries` whose names end in ``.targets``
+ as MSBuild targets files to be imported into generated project files.
diff --git a/Modules/Compiler/Intel-CXX-FeatureTests.cmake b/Modules/Compiler/Intel-CXX-FeatureTests.cmake
index d1a3433..e370647 100644
--- a/Modules/Compiler/Intel-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/Intel-CXX-FeatureTests.cmake
@@ -21,7 +21,7 @@ set(DETECT_CXX11 "((__cplusplus >= 201103L) || defined(__INTEL_CXX11_MODE__) ||
#if you are compiling as 98/11/14. So to properly detect C++14 with this version
#we look for the existence of __GXX_EXPERIMENTAL_CXX0X__ but not __INTEL_CXX11_MODE__
set(DETECT_BUGGY_ICC15 "((__INTEL_COMPILER == 1500) && (__INTEL_COMPILER_UPDATE == 1))")
-set(DETECT_CXX14 "((__cplusplus >= 201300L) || ((__cplusplus == 201103L) && !defined(__INTEL_CXX11_MODE__)) || ((${DETECT_BUGGY_ICC15}) && defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(__INTEL_CXX11_MODE__) ) || (defined(_MSC_VER) && defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi)) )")
+set(DETECT_CXX14 "((__cplusplus >= 201300L) || ((__cplusplus == 201103L) && !defined(__INTEL_CXX11_MODE__)) || ((${DETECT_BUGGY_ICC15}) && defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(__INTEL_CXX11_MODE__) ) || (defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi)) )")
unset(DETECT_BUGGY_ICC15)
set(Intel16_CXX14 "__INTEL_COMPILER >= 1600 && ${DETECT_CXX14}")
@@ -49,7 +49,7 @@ set(Intel15_CXX11 "__INTEL_COMPILER >= 1500 && ${DETECT_CXX11}")
set(_cmake_feature_test_cxx_alignas "${Intel15_CXX11}")
set(_cmake_feature_test_cxx_alignof "${Intel15_CXX11}")
set(_cmake_feature_test_cxx_inheriting_constructors "${Intel15_CXX11}")
-set(_cmake_feature_test_cxx_user_literals "__cpp_user_defined_literals >= 200809 || ${Intel15_CXX11}")
+set(_cmake_feature_test_cxx_user_literals "__cpp_user_defined_literals >= 200809 || (${Intel15_CXX11} && (!defined(_MSC_VER) || __INTEL_COMPILER >= 1600))")
set(_cmake_feature_test_cxx_thread_local "${Intel15_CXX11}")
unset(Intel15_CXX11)
@@ -64,7 +64,7 @@ set(_cmake_feature_test_cxx_sizeof_member "${Intel14_CXX11}")
set(_cmake_feature_test_cxx_strong_enums "${Intel14_CXX11}")
set(_cmake_feature_test_cxx_reference_qualified_functions "${Intel14_CXX11}")
set(_cmake_feature_test_cxx_raw_string_literals "__cpp_raw_strings >= 200710 || ${Intel14_CXX11}")
-set(_cmake_feature_test_cxx_unicode_literals "__cpp_unicode_literals >= 200710 || ${Intel14_CXX11}")
+set(_cmake_feature_test_cxx_unicode_literals "__cpp_unicode_literals >= 200710 || (${Intel14_CXX11} && (!defined(_MSC_VER) || __INTEL_COMPILER >= 1600))")
set(_cmake_feature_test_cxx_inline_namespaces "${Intel14_CXX11}")
set(_cmake_feature_test_cxx_unrestricted_unions "${Intel14_CXX11}")
set(_cmake_feature_test_cxx_nonstatic_member_init "${Intel14_CXX11}")
diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake
index 6673a2d..d01d38d 100644
--- a/Modules/Compiler/Intel-CXX.cmake
+++ b/Modules/Compiler/Intel-CXX.cmake
@@ -10,19 +10,23 @@ set(CMAKE_DEPFILE_FLAGS_CXX "-MD -MT <OBJECT> -MF <DEPFILE>")
if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set(_std -Qstd)
set(_ext c++)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-Qstd=c++14")
+ # todo: there is no gnu++14 value supported; figure out what to do
+ set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-Qstd=c++14")
+ endif()
else()
set(_std -std)
set(_ext gnu++)
-endif()
-
-if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.2)
- set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "${_std}=c++14")
- # todo: there is no gnu++14 value supported; figure out what to do
- set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "${_std}=c++14")
-elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0)
- set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "${_std}=c++1y")
- # todo: there is no gnu++14 value supported; figure out what to do
- set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "${_std}=c++1y")
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.2)
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
+ # todo: there is no gnu++14 value supported; figure out what to do
+ set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=c++14")
+ elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0)
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
+ # todo: there is no gnu++14 value supported; figure out what to do
+ set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=c++1y")
+ endif()
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
@@ -62,7 +66,9 @@ unset(_ext)
macro(cmake_record_cxx_compile_features)
set(_result 0)
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0
+ OR (NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC" AND
+ NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0))
_record_compiler_features_cxx(14)
endif()
if (_result EQUAL 0)
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 1e0be09..1ba4a8f 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -73,6 +73,10 @@ Create custom targets to build projects in external trees
does not output anything which can make the build appear to have stalled.
This option forces Git to output progress information during the clone step
so that forward progress is indicated.
+ ``GIT_CONFIG <option>...``
+ Tell Git to clone with ``--config <option>``. Use additional configuration
+ parameters when cloning the project (``key=value`` as expected by ``git
+ config``).
``HG_REPOSITORY <url>``
URL of mercurial repo
``HG_TAG <tag>``
@@ -514,7 +518,7 @@ define_property(DIRECTORY PROPERTY "EP_UPDATE_DISCONNECTED" INHERITED
"ExternalProject module."
)
-function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_remote_name git_submodules git_shallow git_progress src_name work_dir gitclone_infofile gitclone_stampfile tls_verify)
+function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_remote_name git_submodules git_shallow git_progress git_config src_name work_dir gitclone_infofile gitclone_stampfile tls_verify)
if(NOT GIT_VERSION_STRING VERSION_LESS 1.7.10)
set(git_clone_shallow_options "--depth 1 --no-single-branch")
else()
@@ -565,6 +569,11 @@ if(git_progress)
list(APPEND git_clone_options --progress)
endif()
+set(git_config \"${git_config}\")
+foreach(config IN LISTS git_config)
+ list(APPEND git_clone_options --config \${config})
+endforeach()
+
# try the clone 3 times incase there is an odd git clone issue
set(error_code 1)
set(number_of_tries 0)
@@ -1812,6 +1821,7 @@ function(_ep_add_download_command name)
endif()
get_property(git_shallow TARGET ${name} PROPERTY _EP_GIT_SHALLOW)
get_property(git_progress TARGET ${name} PROPERTY _EP_GIT_PROGRESS)
+ get_property(git_config TARGET ${name} PROPERTY _EP_GIT_CONFIG)
# For the download step, and the git clone operation, only the repository
# should be recorded in a configured RepositoryInfo file. If the repo
@@ -1836,7 +1846,7 @@ function(_ep_add_download_command name)
# The script will delete the source directory and then call git clone.
#
_ep_write_gitclone_script(${tmp_dir}/${name}-gitclone.cmake ${source_dir}
- ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${git_remote_name} "${git_submodules}" "${git_shallow}" "${git_progress}" ${src_name} ${work_dir}
+ ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${git_remote_name} "${git_submodules}" "${git_shallow}" "${git_progress}" "${git_config}" ${src_name} ${work_dir}
${stamp_dir}/${name}-gitinfo.txt ${stamp_dir}/${name}-gitclone-lastrun.txt "${tls_verify}"
)
set(comment "Performing download step (git clone) for '${name}'")
diff --git a/Modules/Platform/Fuchsia.cmake b/Modules/Platform/Fuchsia.cmake
new file mode 100644
index 0000000..896da7b
--- /dev/null
+++ b/Modules/Platform/Fuchsia.cmake
@@ -0,0 +1,25 @@
+set(FUCHSIA 1)
+
+set(CMAKE_DL_LIBS "")
+set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
+set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+
+# Shared libraries with no builtin soname may not be linked safely by
+# specifying the file path.
+set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
+
+# Initialize C link type selection flags. These flags are used when
+# building a shared library, shared module, or executable that links
+# to other libraries to select whether to use the static or shared
+# versions of the libraries.
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+ set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+endforeach()
diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake
index 9a937a7..d8b3957 100644
--- a/Modules/Platform/Windows.cmake
+++ b/Modules/Platform/Windows.cmake
@@ -17,6 +17,7 @@ set(CMAKE_IMPORT_LIBRARY_SUFFIX ".lib")
set(CMAKE_EXECUTABLE_SUFFIX ".exe") # .exe
set(CMAKE_LINK_LIBRARY_SUFFIX ".lib")
set(CMAKE_DL_LIBS "")
+set(CMAKE_EXTRA_LINK_EXTENSIONS ".targets")
set(CMAKE_FIND_LIBRARY_PREFIXES "")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 594f55d..6bee953 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 7)
-set(CMake_VERSION_PATCH 20161111)
+set(CMake_VERSION_PATCH 20161114)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx
index 2e5b56a..a989b12 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -226,6 +226,7 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args,
this->Makefile->AddDefinition(this->Values[ct_RETURN_VALUE],
str.str().c_str());
}
+ this->ProcessAdditionalValues(handler);
// log the error message if there was an error
if (capureCMakeError) {
const char* returnString = "0";
@@ -246,6 +247,10 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args,
return true;
}
+void cmCTestHandlerCommand::ProcessAdditionalValues(cmCTestGenericHandler*)
+{
+}
+
bool cmCTestHandlerCommand::CheckArgumentKeyword(std::string const& arg)
{
// Look for non-value arguments common to all commands.
diff --git a/Source/CTest/cmCTestHandlerCommand.h b/Source/CTest/cmCTestHandlerCommand.h
index 92748af..c86841f 100644
--- a/Source/CTest/cmCTestHandlerCommand.h
+++ b/Source/CTest/cmCTestHandlerCommand.h
@@ -45,6 +45,8 @@ public:
protected:
virtual cmCTestGenericHandler* InitializeHandler() = 0;
+ virtual void ProcessAdditionalValues(cmCTestGenericHandler* handler);
+
// Command argument handling.
virtual bool CheckArgumentKeyword(std::string const& arg);
virtual bool CheckArgumentValue(std::string const& arg);
diff --git a/Source/CTest/cmCTestMemCheckCommand.cxx b/Source/CTest/cmCTestMemCheckCommand.cxx
index 05d0a53..5e4c5ae 100644
--- a/Source/CTest/cmCTestMemCheckCommand.cxx
+++ b/Source/CTest/cmCTestMemCheckCommand.cxx
@@ -4,6 +4,15 @@
#include "cmCTest.h"
#include "cmCTestGenericHandler.h"
+#include "cmCTestMemCheckHandler.h"
+#include "cmMakefile.h"
+
+cmCTestMemCheckCommand::cmCTestMemCheckCommand()
+{
+ this->Arguments[ctm_DEFECT_COUNT] = "DEFECT_COUNT";
+ this->Arguments[ctm_LAST] = CM_NULLPTR;
+ this->Last = ctm_LAST;
+}
cmCTestGenericHandler* cmCTestMemCheckCommand::InitializeActualHandler()
{
@@ -28,3 +37,14 @@ cmCTestGenericHandler* cmCTestMemCheckCommand::InitializeActualHandler()
handler->SetQuiet(this->Quiet);
return handler;
}
+
+void cmCTestMemCheckCommand::ProcessAdditionalValues(
+ cmCTestGenericHandler* handler)
+{
+ if (this->Values[ctm_DEFECT_COUNT] && *this->Values[ctm_DEFECT_COUNT]) {
+ std::ostringstream str;
+ str << static_cast<cmCTestMemCheckHandler*>(handler)->GetDefectCount();
+ this->Makefile->AddDefinition(this->Values[ctm_DEFECT_COUNT],
+ str.str().c_str());
+ }
+}
diff --git a/Source/CTest/cmCTestMemCheckCommand.h b/Source/CTest/cmCTestMemCheckCommand.h
index 30d9e2b..458ebb0 100644
--- a/Source/CTest/cmCTestMemCheckCommand.h
+++ b/Source/CTest/cmCTestMemCheckCommand.h
@@ -20,7 +20,7 @@ class cmCommand;
class cmCTestMemCheckCommand : public cmCTestTestCommand
{
public:
- cmCTestMemCheckCommand() {}
+ cmCTestMemCheckCommand();
/**
* This is a virtual constructor for the command.
@@ -40,6 +40,14 @@ public:
protected:
cmCTestGenericHandler* InitializeActualHandler() CM_OVERRIDE;
+
+ void ProcessAdditionalValues(cmCTestGenericHandler* handler) CM_OVERRIDE;
+
+ enum
+ {
+ ctm_DEFECT_COUNT = ctt_LAST,
+ ctm_LAST
+ };
};
#endif
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 0052a16..0f27fac 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -127,6 +127,7 @@ void cmCTestMemCheckHandler::Initialize()
this->MemoryTesterOptions.clear();
this->MemoryTesterStyle = UNKNOWN;
this->MemoryTesterOutputFile = "";
+ this->DefectCount = 0;
}
int cmCTestMemCheckHandler::PreProcessHandler()
@@ -279,6 +280,11 @@ void cmCTestMemCheckHandler::PopulateCustomVectors(cmMakefile* mf)
this->Quiet);
}
+int cmCTestMemCheckHandler::GetDefectCount()
+{
+ return this->DefectCount;
+}
+
void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml)
{
if (!this->CTest->GetProduceXML()) {
@@ -354,7 +360,7 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml)
xml.EndElement(); // Results
xml.StartElement("Log");
- if (this->CTest->ShouldCompressMemCheckOutput()) {
+ if (this->CTest->ShouldCompressTestOutput()) {
this->CTest->CompressString(memcheckstr);
xml.Attribute("compression", "gzip");
xml.Attribute("encoding", "base64");
@@ -702,6 +708,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput(
ostr << *i << std::endl;
}
log = ostr.str();
+ this->DefectCount += defects;
return defects == 0;
}
bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
@@ -743,6 +750,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
}
log = ostr.str();
+ this->DefectCount += defects;
return defects == 0;
}
@@ -878,6 +886,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
<< (cmSystemTools::GetTime() - sttime) << std::endl,
this->Quiet);
log = ostr.str();
+ this->DefectCount += defects;
return defects == 0;
}
@@ -923,9 +932,9 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
// only put the output of Bounds Checker if there were
// errors or leaks detected
log = parser.Log;
- return false;
}
- return true;
+ this->DefectCount += defects;
+ return defects == 0;
}
// PostProcessTest memcheck results
diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h
index b12da28..5faace0 100644
--- a/Source/CTest/cmCTestMemCheckHandler.h
+++ b/Source/CTest/cmCTestMemCheckHandler.h
@@ -30,6 +30,8 @@ public:
void Initialize() CM_OVERRIDE;
+ int GetDefectCount();
+
protected:
int PreProcessHandler() CM_OVERRIDE;
int PostProcessHandler() CM_OVERRIDE;
@@ -105,6 +107,7 @@ private:
std::vector<std::string> ResultStringsLong;
std::vector<int> GlobalResults;
bool LogWithPID; // does log file add pid
+ int DefectCount;
std::vector<int>::size_type FindOrAddWarning(const std::string& warning);
// initialize the ResultStrings and ResultStringsLong for
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index b30f6eb..fbc94cc 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -153,7 +153,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
if ((!this->TestHandler->MemCheck &&
this->CTest->ShouldCompressTestOutput()) ||
(this->TestHandler->MemCheck &&
- this->CTest->ShouldCompressMemCheckOutput())) {
+ this->CTest->ShouldCompressTestOutput())) {
this->CompressOutput();
}
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index d10f7ad..8383132 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -46,7 +46,6 @@ public:
};
StatusType Status;
- std::string CDashVersion;
std::string Filename;
std::string MD5;
std::string Message;
@@ -63,12 +62,10 @@ private:
return val;
}
- void StartElement(const std::string& name, const char** atts) CM_OVERRIDE
+ void StartElement(const std::string& /*name*/,
+ const char** /*atts*/) CM_OVERRIDE
{
this->CurrentValue.clear();
- if (name == "cdash") {
- this->CDashVersion = this->FindAttribute(atts, "version");
- }
}
void CharacterDataHandler(const char* data, int length) CM_OVERRIDE
@@ -470,20 +467,6 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
// Now run off and do what you've been told!
res = ::curl_easy_perform(curl);
- if (cmSystemTools::IsOn(this->GetOption("InternalTest")) &&
- cmSystemTools::VersionCompare(cmSystemTools::OP_LESS,
- this->CTest->GetCDashVersion().c_str(),
- "1.7")) {
- // mock failure output for internal test case
- std::string mock_output =
- "<cdash version=\"1.7.0\">\n"
- " <status>ERROR</status>\n"
- " <message>Checksum failed for file.</message>\n"
- "</cdash>\n";
- chunk.clear();
- chunk.assign(mock_output.begin(), mock_output.end());
- }
-
if (!chunk.empty()) {
cmCTestOptionalLog(this->CTest, DEBUG, "CURL output: ["
<< cmCTestLogWrite(&*chunk.begin(), chunk.size())
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 010fc4e..f35a0b3 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -271,7 +271,6 @@ cmCTest::cmCTest()
this->UseHTTP10 = false;
this->PrintLabels = false;
this->CompressTestOutput = true;
- this->CompressMemCheckOutput = true;
this->TestModel = cmCTest::EXPERIMENTAL;
this->MaxTestNameWidth = 30;
this->InteractiveDebugMode = true;
@@ -289,8 +288,6 @@ cmCTest::cmCTest()
this->DartVersion = 1;
this->DropSiteCDash = false;
this->OutputTestOutputOnTestFailure = false;
- this->ComputedCompressTestOutput = false;
- this->ComputedCompressMemCheckOutput = false;
this->RepeatTests = 1; // default to run each test once
this->RepeatUntilFail = false;
std::string outOnFail;
@@ -358,53 +355,9 @@ void cmCTest::SetTestLoad(unsigned long load)
bool cmCTest::ShouldCompressTestOutput()
{
- if (!this->ComputedCompressTestOutput) {
- std::string cdashVersion = this->GetCDashVersion();
- // version >= 1.6?
- bool cdashSupportsGzip = cmSystemTools::VersionCompare(
- cmSystemTools::OP_GREATER_EQUAL, cdashVersion.c_str(), "1.6");
- this->CompressTestOutput &= cdashSupportsGzip;
- this->ComputedCompressTestOutput = true;
- }
return this->CompressTestOutput;
}
-bool cmCTest::ShouldCompressMemCheckOutput()
-{
- if (!this->ComputedCompressMemCheckOutput) {
- std::string cdashVersion = this->GetCDashVersion();
-
- bool compressionSupported = cmSystemTools::VersionCompare(
- cmSystemTools::OP_GREATER, cdashVersion.c_str(), "1.9.0");
- this->CompressMemCheckOutput &= compressionSupported;
- this->ComputedCompressMemCheckOutput = true;
- }
- return this->CompressMemCheckOutput;
-}
-
-std::string cmCTest::GetCDashVersion()
-{
-#ifdef CMAKE_BUILD_WITH_CMAKE
- // First query the server. If that fails, fall back to the local setting
- std::string response;
- std::string url = "http://";
- url += this->GetCTestConfiguration("DropSite");
-
- std::string cdashUri = this->GetCTestConfiguration("DropLocation");
- cdashUri = cdashUri.substr(0, cdashUri.find("/submit.php"));
-
- int res = 1;
- if (!cdashUri.empty()) {
- url += cdashUri + "/api/getversion.php";
- res = cmCTest::HTTPRequest(url, cmCTest::HTTP_GET, response, "", "", 3);
- }
-
- return res ? this->GetCTestConfiguration("CDashVersion") : response;
-#else
- return this->GetCTestConfiguration("CDashVersion");
-#endif
-}
-
cmCTest::Part cmCTest::GetPartFromName(const char* name)
{
// Look up by lower-case to make names case-insensitive.
@@ -1746,7 +1699,6 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
if (this->CheckArgument(arg, "--no-compress-output")) {
this->CompressTestOutput = false;
- this->CompressMemCheckOutput = false;
}
if (this->CheckArgument(arg, "--print-labels")) {
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 8d3f8fb..e5b4728 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -232,11 +232,8 @@ public:
bool ShouldPrintLabels() { return this->PrintLabels; }
bool ShouldCompressTestOutput();
- bool ShouldCompressMemCheckOutput();
bool CompressString(std::string& str);
- std::string GetCDashVersion();
-
std::string GetStopTime() { return this->StopTime; }
void SetStopTime(std::string const& time);
@@ -487,10 +484,6 @@ private:
bool RunConfigurationScript;
- // flag for lazy getter (optimization)
- bool ComputedCompressTestOutput;
- bool ComputedCompressMemCheckOutput;
-
int GenerateNotesFile(const char* files);
void DetermineNextDayStop();
@@ -547,7 +540,6 @@ private:
bool CompressXMLFiles;
bool CompressTestOutput;
- bool CompressMemCheckOutput;
void InitStreams();
std::ostream* StreamOut;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 97eb3c7..5dd9e48 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -53,6 +53,12 @@ static std::string cmVS10EscapeComment(std::string comment)
return echoable;
}
+static bool cmVS10IsTargetsFile(std::string const& path)
+{
+ std::string const ext = cmSystemTools::GetFilenameLastExtension(path);
+ return cmSystemTools::Strucmp(ext.c_str(), ".targets") == 0;
+}
+
cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator(
cmGeneratorTarget* target, cmGlobalVisualStudio10Generator* gg)
{
@@ -160,6 +166,9 @@ void cmVisualStudio10TargetGenerator::Generate()
if (!this->ComputeLinkOptions()) {
return;
}
+ if (!this->ComputeLibOptions()) {
+ return;
+ }
}
std::string path = this->LocalGenerator->GetCurrentBinaryDirectory();
path += "/";
@@ -364,6 +373,7 @@ void cmVisualStudio10TargetGenerator::Generate()
1);
this->WriteTargetSpecificReferences();
this->WriteString("<ImportGroup Label=\"ExtensionTargets\">\n", 1);
+ this->WriteTargetsFileReferences();
if (this->GlobalGenerator->IsMasmEnabled()) {
this->WriteString("<Import Project=\"$(VCTargetsPath)\\"
"BuildCustomizations\\masm.targets\" />\n",
@@ -479,6 +489,31 @@ void cmVisualStudio10TargetGenerator::WriteTargetSpecificReferences()
}
}
+void cmVisualStudio10TargetGenerator::WriteTargetsFileReferences()
+{
+ for (std::vector<TargetsFileAndConfigs>::iterator i =
+ this->TargetsFileAndConfigsVec.begin();
+ i != this->TargetsFileAndConfigsVec.end(); ++i) {
+ TargetsFileAndConfigs const& tac = *i;
+ this->WriteString("<Import Project=\"", 3);
+ (*this->BuildFileStream) << tac.File << "\" ";
+ (*this->BuildFileStream) << "Condition=\"";
+ (*this->BuildFileStream) << "Exists('" << tac.File << "')";
+ if (!tac.Configs.empty()) {
+ (*this->BuildFileStream) << " And (";
+ for (size_t j = 0; j < tac.Configs.size(); ++j) {
+ if (j > 0) {
+ (*this->BuildFileStream) << " Or ";
+ }
+ (*this->BuildFileStream) << "'$(Configuration)'=='" << tac.Configs[j]
+ << "'";
+ }
+ (*this->BuildFileStream) << ")";
+ }
+ (*this->BuildFileStream) << "\" />\n";
+ }
+}
+
void cmVisualStudio10TargetGenerator::WriteWinRTReferences()
{
std::vector<std::string> references;
@@ -2148,9 +2183,16 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
}
// add the libraries for the target to libs string
cmComputeLinkInformation& cli = *pcli;
- this->AddLibraries(cli, libVec);
+ std::vector<std::string> vsTargetVec;
+ this->AddLibraries(cli, libVec, vsTargetVec);
linkOptions.AddFlag("AdditionalDependencies", libVec);
+ // Populate TargetsFileAndConfigsVec
+ for (std::vector<std::string>::iterator ti = vsTargetVec.begin();
+ ti != vsTargetVec.end(); ++ti) {
+ this->AddTargetsFileAndConfigPair(*ti, config);
+ }
+
std::vector<std::string> const& ldirs = cli.GetDirectories();
std::vector<std::string> linkDirs;
for (std::vector<std::string>::const_iterator d = ldirs.begin();
@@ -2305,6 +2347,49 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
return true;
}
+bool cmVisualStudio10TargetGenerator::ComputeLibOptions()
+{
+ if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
+ for (std::vector<std::string>::const_iterator i =
+ this->Configurations.begin();
+ i != this->Configurations.end(); ++i) {
+ if (!this->ComputeLibOptions(*i)) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+bool cmVisualStudio10TargetGenerator::ComputeLibOptions(
+ std::string const& config)
+{
+ cmComputeLinkInformation* pcli =
+ this->GeneratorTarget->GetLinkInformation(config.c_str());
+ if (!pcli) {
+ cmSystemTools::Error(
+ "CMake can not compute cmComputeLinkInformation for target: ",
+ this->Name.c_str());
+ return false;
+ }
+
+ cmComputeLinkInformation& cli = *pcli;
+ typedef cmComputeLinkInformation::ItemVector ItemVector;
+ const ItemVector& libs = cli.GetItems();
+ std::string currentBinDir =
+ this->LocalGenerator->GetCurrentBinaryDirectory();
+ for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) {
+ if (l->IsPath && cmVS10IsTargetsFile(l->Value)) {
+ std::string path = this->LocalGenerator->ConvertToRelativePath(
+ currentBinDir, l->Value.c_str());
+ this->ConvertToWindowsSlash(path);
+ this->AddTargetsFileAndConfigPair(path, config);
+ }
+ }
+
+ return true;
+}
+
void cmVisualStudio10TargetGenerator::WriteLinkOptions(
std::string const& config)
{
@@ -2329,10 +2414,11 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(
}
void cmVisualStudio10TargetGenerator::AddLibraries(
- cmComputeLinkInformation& cli, std::vector<std::string>& libVec)
+ cmComputeLinkInformation& cli, std::vector<std::string>& libVec,
+ std::vector<std::string>& vsTargetVec)
{
typedef cmComputeLinkInformation::ItemVector ItemVector;
- ItemVector libs = cli.GetItems();
+ ItemVector const& libs = cli.GetItems();
std::string currentBinDir =
this->LocalGenerator->GetCurrentBinaryDirectory();
for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) {
@@ -2340,7 +2426,11 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
std::string path = this->LocalGenerator->ConvertToRelativePath(
currentBinDir, l->Value.c_str());
this->ConvertToWindowsSlash(path);
- libVec.push_back(path);
+ if (cmVS10IsTargetsFile(l->Value)) {
+ vsTargetVec.push_back(path);
+ } else {
+ libVec.push_back(path);
+ }
} else if (!l->Target ||
l->Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
libVec.push_back(l->Value);
@@ -2348,6 +2438,26 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
}
}
+void cmVisualStudio10TargetGenerator::AddTargetsFileAndConfigPair(
+ std::string const& targetsFile, std::string const& config)
+{
+ for (std::vector<TargetsFileAndConfigs>::iterator i =
+ this->TargetsFileAndConfigsVec.begin();
+ i != this->TargetsFileAndConfigsVec.end(); ++i) {
+ if (cmSystemTools::ComparePath(targetsFile, i->File)) {
+ if (std::find(i->Configs.begin(), i->Configs.end(), config) ==
+ i->Configs.end()) {
+ i->Configs.push_back(config);
+ }
+ return;
+ }
+ }
+ TargetsFileAndConfigs entry;
+ entry.File = targetsFile;
+ entry.Configs.push_back(config);
+ this->TargetsFileAndConfigsVec.push_back(entry);
+}
+
void cmVisualStudio10TargetGenerator::WriteMidlOptions(
std::string const& /*config*/, std::vector<std::string> const& includes)
{
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 54b9569..1fa844c 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -41,6 +41,12 @@ private:
{
};
+ struct TargetsFileAndConfigs
+ {
+ std::string File;
+ std::vector<std::string> Configs;
+ };
+
std::string ConvertPath(std::string const& path, bool forceRelative);
void ConvertToWindowsSlash(std::string& s);
void WriteString(const char* line, int indentLevel);
@@ -77,6 +83,7 @@ private:
std::string const& version);
void WriteCommonMissingFiles(const std::string& manifestFile);
void WriteTargetSpecificReferences();
+ void WriteTargetsFileReferences();
bool ComputeClOptions();
bool ComputeClOptions(std::string const& configName);
@@ -92,6 +99,8 @@ private:
std::vector<std::string> const& includes);
bool ComputeLinkOptions();
bool ComputeLinkOptions(std::string const& config);
+ bool ComputeLibOptions();
+ bool ComputeLibOptions(std::string const& config);
void WriteLinkOptions(std::string const& config);
void WriteMidlOptions(std::string const& config,
std::vector<std::string> const& includes);
@@ -106,7 +115,10 @@ private:
void WriteApplicationTypeSettings();
bool OutputSourceSpecificFlags(cmSourceFile const* source);
void AddLibraries(cmComputeLinkInformation& cli,
- std::vector<std::string>& libVec);
+ std::vector<std::string>& libVec,
+ std::vector<std::string>& vsTargetVec);
+ void AddTargetsFileAndConfigPair(std::string const& targetsFile,
+ std::string const& config);
void WriteLibOptions(std::string const& config);
void WriteManifestOptions(std::string const& config);
void WriteEvents(std::string const& configName);
@@ -132,6 +144,7 @@ private:
OptionsMap LinkOptions;
std::string PathToVcxproj;
std::vector<std::string> Configurations;
+ std::vector<TargetsFileAndConfigs> TargetsFileAndConfigsVec;
cmGeneratorTarget* GeneratorTarget;
cmMakefile* Makefile;
std::string Platform;
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index 9f61186..8acdd93 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -170,6 +170,15 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
endif()
endif()
+if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ if (CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.2)
+ # This works on some pre-15.0.2 versions and not others.
+ list(REMOVE_ITEM C_non_features
+ c_static_assert
+ )
+ endif()
+endif()
+
set(C_ext c)
set(C_standard_flag 11)
set(CXX_ext cpp)
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index ca6462d..72c20eb 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -363,6 +363,23 @@ if(do_git_tests)
)
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+ # Live git / master (no GIT_TAG), but git config flags
+ #
+ # The `git clone --config` parameter has been introduced in Git 1.7.7
+ if(NOT git_version VERSION_LESS 1.7.7)
+ set(proj TutorialStep1-GIT-config)
+ ExternalProject_Add(${proj}
+ GIT_REPOSITORY "${local_git_repo}"
+ GIT_CONFIG core.eol=lf core.autocrlf=input
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalGITRepository"
+ LOG_UPDATE 1
+ )
+ set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+ endif()
+
# git by explicit branch/tag with empty submodule list
#
set(proj TutorialStep1-GIT-bytag-withsubmodules)
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index 2bc3693..e936dab 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -135,6 +135,7 @@ function(run_TestOutputSize)
")
run_cmake_command(TestOutputSize
${CMAKE_CTEST_COMMAND} -M Experimental -T Test
+ --no-compress-output
--test-output-size-passed 10
--test-output-size-failed 12
)
diff --git a/Tests/RunCMake/RunCTest.cmake b/Tests/RunCMake/RunCTest.cmake
index e94432b..89e16ee 100644
--- a/Tests/RunCMake/RunCTest.cmake
+++ b/Tests/RunCMake/RunCTest.cmake
@@ -12,6 +12,7 @@ function(run_ctest CASE_NAME)
-S ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake
-V
--output-log ${RunCMake_BINARY_DIR}/${CASE_NAME}-build/testOutput.log
+ --no-compress-output
${ARGN}
)
endfunction()
diff --git a/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-result.txt b/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-stderr.txt b/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-stderr.txt
new file mode 100644
index 0000000..d4b71ae
--- /dev/null
+++ b/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-stderr.txt
@@ -0,0 +1 @@
+Defect count: 3
diff --git a/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-stdout.txt b/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-stdout.txt
new file mode 100644
index 0000000..97a8a9b
--- /dev/null
+++ b/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-stdout.txt
@@ -0,0 +1,3 @@
+Memory checking results:
+Direct leak - 2
+Indirect leak - 1
diff --git a/Tests/RunCMake/ctest_memcheck/DummyValgrindNoDefects-result.txt b/Tests/RunCMake/ctest_memcheck/DummyValgrindNoDefects-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/ctest_memcheck/DummyValgrindNoDefects-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/ctest_memcheck/DummyValgrindNoDefects-stderr.txt b/Tests/RunCMake/ctest_memcheck/DummyValgrindNoDefects-stderr.txt
new file mode 100644
index 0000000..ad28645
--- /dev/null
+++ b/Tests/RunCMake/ctest_memcheck/DummyValgrindNoDefects-stderr.txt
@@ -0,0 +1 @@
+Defect count: 0
diff --git a/Tests/RunCMake/ctest_memcheck/DummyValgrindNoDefects-stdout.txt b/Tests/RunCMake/ctest_memcheck/DummyValgrindNoDefects-stdout.txt
new file mode 100644
index 0000000..dabb004
--- /dev/null
+++ b/Tests/RunCMake/ctest_memcheck/DummyValgrindNoDefects-stdout.txt
@@ -0,0 +1,6 @@
+1/1 MemCheck #1: RunCMake \.+ Passed +[0-9]+.[0-9]+ sec
+
+100% tests passed, 0 tests failed out of 1
+.*
+-- Processing memory checking output:( )
+Memory checking results:
diff --git a/Tests/RunCMake/ctest_memcheck/RunCMakeTest.cmake b/Tests/RunCMake/ctest_memcheck/RunCMakeTest.cmake
index 5ad6511..212bfdb 100644
--- a/Tests/RunCMake/ctest_memcheck/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_memcheck/RunCMakeTest.cmake
@@ -12,6 +12,8 @@ endfunction()
unset(CTEST_EXTRA_CONFIG)
unset(CTEST_EXTRA_CODE)
+unset(CTEST_SUFFIX_CODE)
+unset(CTEST_MEMCHECK_ARGS)
unset(CMAKELISTS_EXTRA_CODE)
#-----------------------------------------------------------------------------
@@ -132,4 +134,31 @@ run_mc_test(DummyValgrindNoLogFile "${PSEUDO_VALGRIND_NOLOG}")
run_mc_test(DummyBCNoLogFile "${PSEUDO_BC_NOLOG}")
run_mc_test(NotExist "\${CTEST_BINARY_DIRECTORY}/no-memcheck-exe")
run_mc_test(Unknown "\${CMAKE_COMMAND}")
-run_mc_test(DummyQuiet "${PSEUDO_VALGRIND}" -DMEMCHECK_ARGS=QUIET)
+
+#----------------------------------------------------------------------------
+set(CTEST_MEMCHECK_ARGS QUIET)
+run_mc_test(DummyQuiet "${PSEUDO_VALGRIND}")
+unset(CTEST_MEMCHECK_ARGS)
+
+#-----------------------------------------------------------------------------
+set(CTEST_SUFFIX_CODE "message(\"Defect count: \${defect_count}\")")
+set(CTEST_MEMCHECK_ARGS "DEFECT_COUNT defect_count")
+run_mc_test(DummyValgrindNoDefects "${PSEUDO_VALGRIND}")
+unset(CTEST_MEMCHECK_ARGS)
+unset(CTEST_SUFFIX_CODE)
+
+#-----------------------------------------------------------------------------
+set(CTEST_SUFFIX_CODE "message(\"Defect count: \${defect_count}\")")
+set(CTEST_MEMCHECK_ARGS "DEFECT_COUNT defect_count")
+set(CTEST_EXTRA_CODE
+"set(CTEST_MEMORYCHECK_SANITIZER_OPTIONS \"simulate_sanitizer=1 report_bugs=1 history_size=5 exitcode=55\")
+")
+set(CMAKELISTS_EXTRA_CODE
+"add_test(NAME TestSan COMMAND \"${CMAKE_COMMAND}\"
+-P \"${RunCMake_SOURCE_DIR}/testLeakSanitizer.cmake\")
+")
+run_mc_test(DummyLeakSanitizerPrintDefects "" -DMEMCHECK_TYPE=AddressSanitizer)
+unset(CMAKELISTS_EXTRA_CODE)
+unset(CTEST_EXTRA_CODE)
+unset(CTEST_MEMCHECK_ARGS)
+unset(CTEST_SUFFIX_CODE)
diff --git a/Tests/RunCMake/ctest_memcheck/test.cmake.in b/Tests/RunCMake/ctest_memcheck/test.cmake.in
index 8431fa6..50b4b6a 100644
--- a/Tests/RunCMake/ctest_memcheck/test.cmake.in
+++ b/Tests/RunCMake/ctest_memcheck/test.cmake.in
@@ -21,4 +21,6 @@ set(CTEST_MEMORYCHECK_TYPE "${MEMCHECK_TYPE}")
CTEST_START(Experimental)
CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res ${MEMCHECK_ARGS})
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res @CTEST_MEMCHECK_ARGS@)
+
+@CTEST_SUFFIX_CODE@