summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/command/ctest_test.rst3
-rw-r--r--Help/manual/cmake-variables.7.rst2
-rw-r--r--Help/manual/ctest.1.rst6
-rw-r--r--Help/release/dev/ctest-custom-output-size.rst7
-rw-r--r--Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst6
-rw-r--r--Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst6
-rw-r--r--Modules/CMakeCCompiler.cmake.in8
-rw-r--r--Modules/CMakeCXXCompiler.cmake.in8
-rw-r--r--Modules/CMakeClDeps.cmake34
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake1
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake1
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake65
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestTestHandler.h5
-rw-r--r--Source/cmCTest.cxx41
-rw-r--r--Source/cmGeneratorTarget.cxx12
-rw-r--r--Source/cmGlobalGenerator.cxx5
-rw-r--r--Source/cmGlobalGenerator.h3
-rw-r--r--Source/cmLocalGenerator.cxx2
-rw-r--r--Source/cmNinjaTargetGenerator.cxx2
-rw-r--r--Source/cmSystemTools.cxx14
-rw-r--r--Source/cmSystemTools.h1
-rw-r--r--Source/cmTarget.cxx4
-rw-r--r--Source/ctest.cxx4
-rw-r--r--Tests/RunCMake/CMP0026/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CMP0026/clear-cached-information.cmake14
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestOutputSize-check.cmake17
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestOutputSize-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestOutputSize-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_test/CMakeLists.txt.in1
-rw-r--r--Tests/RunCMake/ctest_test/RunCMakeTest.cmake15
-rw-r--r--Tests/RunCMake/ctest_test/TestOutputSize-check.cmake17
34 files changed, 251 insertions, 77 deletions
diff --git a/Help/command/ctest_test.rst b/Help/command/ctest_test.rst
index 162db69..412e323 100644
--- a/Help/command/ctest_test.rst
+++ b/Help/command/ctest_test.rst
@@ -85,3 +85,6 @@ The options are:
been printed to the console. Output from the underlying test command is not
affected. Summary info detailing the percentage of passing tests is also
unaffected by the ``QUIET`` option.
+
+See also the :variable:`CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE`
+and :variable:`CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE` variables.
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index e0dbdeb..660d544 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -374,6 +374,8 @@ Variables for CTest
/variable/CTEST_COVERAGE_COMMAND
/variable/CTEST_COVERAGE_EXTRA_FLAGS
/variable/CTEST_CURL_OPTIONS
+ /variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE
+ /variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE
/variable/CTEST_CVS_CHECKOUT
/variable/CTEST_CVS_COMMAND
/variable/CTEST_CVS_UPDATE_OPTIONS
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 50c856a..2fdf7f3 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -302,6 +302,12 @@ Options
``--test-command``
The test to run with the --build-and-test option.
+``--test-output-size-passed <size>``
+ Limit the output for passed tests to <size> bytes.
+
+``--test-output-size-failed <size>``
+ Limit the output for failed tests to <size> bytes.
+
``--test-timeout``
The time limit in seconds, internal use only.
diff --git a/Help/release/dev/ctest-custom-output-size.rst b/Help/release/dev/ctest-custom-output-size.rst
new file mode 100644
index 0000000..8098b93
--- /dev/null
+++ b/Help/release/dev/ctest-custom-output-size.rst
@@ -0,0 +1,7 @@
+ctest-custom-output-size
+------------------------
+
+* :manual:`ctest(1)` learned options
+ ``--test-output-size-passed`` and ``--test-output-size-failed``
+ to customize the limit on test output size submitted when
+ running as a :ref:`Dashboard Client`.
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
new file mode 100644
index 0000000..1b4bb01
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
@@ -0,0 +1,6 @@
+CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE
+--------------------------------------------
+
+Specify the maximum amount of output from a failed test that will
+be collected by the :command:`ctest_test` command. If not set,
+the default is 300 KiB.
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
new file mode 100644
index 0000000..168e84e
--- /dev/null
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
@@ -0,0 +1,6 @@
+CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE
+--------------------------------------------
+
+Specify the maximum amount of output from a passed test that will
+be collected by the :command:`ctest_test` command. If not set,
+the default is 1 KiB.
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 2ad2f34..c72e338 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -53,12 +53,14 @@ if(CMAKE_C_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
endif()
+set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "@CMAKE_C_CL_SHOWINCLUDES_PREFIX@")
+if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
+ set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
+endif()
+
@CMAKE_C_SYSROOT_FLAG_CODE@
@CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
-
-@SET_CMAKE_CMCLDEPS_EXECUTABLE@
-@SET_CMAKE_CL_SHOWINCLUDES_PREFIX@
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index c6582a7..52e44f6 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -54,12 +54,14 @@ if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
endif()
+set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "@CMAKE_CXX_CL_SHOWINCLUDES_PREFIX@")
+if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX)
+ set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}")
+endif()
+
@CMAKE_CXX_SYSROOT_FLAG_CODE@
@CMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
-
-@SET_CMAKE_CMCLDEPS_EXECUTABLE@
-@SET_CMAKE_CL_SHOWINCLUDES_PREFIX@
diff --git a/Modules/CMakeClDeps.cmake b/Modules/CMakeClDeps.cmake
deleted file mode 100644
index b46e7c2..0000000
--- a/Modules/CMakeClDeps.cmake
+++ /dev/null
@@ -1,34 +0,0 @@
-
-#=============================================================================
-# Copyright 2012 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
-
-#
-# When using Ninja cl.exe is wrapped by cmcldeps to extract the included
-# headers for dependency tracking.
-#
-# cmcldeps path is set, and cmcldeps needs to know the localized string
-# in front of each include path, so it can remove it.
-#
-
-if(CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND)
- string(REPLACE "cmake.exe" "cmcldeps.exe" CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND})
- set(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
- file(WRITE ${showdir}/foo.h "\n")
- file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
- execute_process(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
- WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE outLine)
- string(REGEX MATCH "\n([^:]*:[^:]*:[ \t]*)" tmp "${outLine}")
- set(localizedPrefix "${CMAKE_MATCH_1}")
- set(SET_CMAKE_CMCLDEPS_EXECUTABLE "set(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
- set(SET_CMAKE_CL_SHOWINCLUDES_PREFIX "set(CMAKE_CL_SHOWINCLUDES_PREFIX \"${localizedPrefix}\")")
-endif()
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 9bd1d67..4b0d278 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -173,7 +173,6 @@ endif ()
include(CMakeFindBinUtils)
if(MSVC_C_ARCHITECTURE_ID)
- include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
set(SET_MSVC_C_ARCHITECTURE_ID
"set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
endif()
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index f25a2db..680356d 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -171,7 +171,6 @@ endif ()
include(CMakeFindBinUtils)
if(MSVC_CXX_ARCHITECTURE_ID)
- include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
set(SET_MSVC_CXX_ARCHITECTURE_ID
"set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
endif()
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 81f4ae6..df6daf3 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -75,6 +75,12 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
set(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
endif()
+ if(CMAKE_GENERATOR STREQUAL "Ninja" AND MSVC_${lang}_ARCHITECTURE_ID)
+ CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX(${lang})
+ else()
+ set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "")
+ endif()
+
# Display the final identification result.
if(CMAKE_${lang}_COMPILER_ID)
if(CMAKE_${lang}_COMPILER_VERSION)
@@ -99,6 +105,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE)
+ set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX}" PARENT_SCOPE)
set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
set(CMAKE_${lang}_SIMULATE_ID "${CMAKE_${lang}_SIMULATE_ID}" PARENT_SCOPE)
set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE)
@@ -314,29 +321,17 @@ Id flags: ${testflags}
endif()
endif()
else()
- if(COMMAND EXECUTE_PROCESS)
- execute_process(
- COMMAND "${CMAKE_${lang}_COMPILER}"
- ${CMAKE_${lang}_COMPILER_ID_ARG1}
- ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
- ${testflags}
- "${src}"
- WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
- OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
- ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
- RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
- )
- else()
- exec_program(
- "${CMAKE_${lang}_COMPILER}" ${CMAKE_${lang}_COMPILER_ID_DIR}
- ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1}
- ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
- ${testflags}
- \"${src}\"
- OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
- RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT
- )
- endif()
+ execute_process(
+ COMMAND "${CMAKE_${lang}_COMPILER}"
+ ${CMAKE_${lang}_COMPILER_ID_ARG1}
+ ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
+ ${testflags}
+ "${src}"
+ WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
+ OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
+ ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
+ RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
+ )
endif()
# Check the result of compilation.
@@ -650,3 +645,27 @@ function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
endif()
endforeach()
endfunction()
+
+function(CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX lang)
+ # Run this MSVC-compatible compiler to detect what the /showIncludes
+ # option displays. We can use a C source even with the C++ compiler
+ # because MSVC-compatible compilers handle both and show the same output.
+ set(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
+ file(WRITE ${showdir}/foo.h "\n")
+ file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
+ execute_process(
+ COMMAND "${CMAKE_${lang}_COMPILER}"
+ ${CMAKE_${lang}_COMPILER_ID_ARG1}
+ ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
+ /nologo /showIncludes /c main.c
+ WORKING_DIRECTORY ${showdir}
+ OUTPUT_VARIABLE out
+ ERROR_VARIABLE err
+ RESULT_VARIABLE res
+ )
+ if(res EQUAL 0 AND "${out}" MATCHES "\n([^:]*:[^:]*:[ \t]*)")
+ set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_MATCH_1}" PARENT_SCOPE)
+ else()
+ set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "" PARENT_SCOPE)
+ endif()
+endfunction()
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index e6f60f1..17f8db5 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 3)
-set(CMake_VERSION_PATCH 20150918)
+set(CMake_VERSION_PATCH 20150921)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index 14067d5..c635430 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -65,6 +65,11 @@ public:
void SetMaxIndex(int n) {this->MaxIndex = n;}
int GetMaxIndex() {return this->MaxIndex;}
+ void SetTestOutputSizePassed(int n)
+ { this->CustomMaximumPassedTestOutputSize = n; }
+ void SetTestOutputSizeFailed(int n)
+ { this->CustomMaximumFailedTestOutputSize = n; }
+
///! pass the -I argument down
void SetTestsToRunInformation(const char*);
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index b2ad4a8..6e55d89 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -2165,7 +2165,46 @@ bool cmCTest::HandleCommandLineArguments(size_t &i,
{
this->OutputTestOutputOnTestFailure = true;
}
-
+ if (this->CheckArgument(arg, "--test-output-size-passed") &&
+ i < args.size() - 1)
+ {
+ i++;
+ long outputSize;
+ if (cmSystemTools::StringToLong(args[i].c_str(), &outputSize))
+ {
+ if (cmCTestTestHandler *pCTestTestHandler =
+ static_cast<cmCTestTestHandler*>(this->TestingHandlers["test"]))
+ {
+ pCTestTestHandler->SetTestOutputSizePassed(int(outputSize));
+ }
+ }
+ else
+ {
+ cmCTestLog(this, WARNING,
+ "Invalid value for '--test-output-size-passed': " <<
+ args[i] << "\n");
+ }
+ }
+ if (this->CheckArgument(arg, "--test-output-size-failed") &&
+ i < args.size() - 1)
+ {
+ i++;
+ long outputSize;
+ if (cmSystemTools::StringToLong(args[i].c_str(), &outputSize))
+ {
+ if (cmCTestTestHandler *pCTestTestHandler =
+ static_cast<cmCTestTestHandler*>(this->TestingHandlers["test"]))
+ {
+ pCTestTestHandler->SetTestOutputSizeFailed(int(outputSize));
+ }
+ }
+ else
+ {
+ cmCTestLog(this, WARNING,
+ "Invalid value for '--test-output-size-failed': " <<
+ args[i] << "\n");
+ }
+ }
if(this->CheckArgument(arg, "-N", "--show-only"))
{
this->ShowOnly = true;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index fb5805b..555c437 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -2218,7 +2218,7 @@ cmGeneratorTarget::GetIncludeDirectories(const std::string& config,
"INCLUDE_DIRECTORIES")
!= debugProperties.end();
- if (this->Makefile->IsConfigured())
+ if (this->GlobalGenerator->GetConfigureDoneCMP0026())
{
this->DebugIncludesDone = true;
}
@@ -2365,7 +2365,7 @@ void cmGeneratorTarget::GetCompileOptions(std::vector<std::string> &result,
"COMPILE_OPTIONS")
!= debugProperties.end();
- if (this->Makefile->IsConfigured())
+ if (this->GlobalGenerator->GetConfigureDoneCMP0026())
{
this->DebugCompileOptionsDone = true;
}
@@ -2435,7 +2435,7 @@ void cmGeneratorTarget::GetCompileFeatures(std::vector<std::string> &result,
"COMPILE_FEATURES")
!= debugProperties.end();
- if (this->Makefile->IsConfigured())
+ if (this->GlobalGenerator->GetConfigureDoneCMP0026())
{
this->DebugCompileFeaturesDone = true;
}
@@ -2503,7 +2503,7 @@ void cmGeneratorTarget::GetCompileDefinitions(std::vector<std::string> &list,
"COMPILE_DEFINITIONS")
!= debugProperties.end();
- if (this->Makefile->IsConfigured())
+ if (this->GlobalGenerator->GetConfigureDoneCMP0026())
{
this->DebugCompileDefinitionsDone = true;
}
@@ -3937,7 +3937,7 @@ cmGeneratorTarget::ReportPropertyOrigin(const std::string &p,
p)
!= debugProperties.end();
- if (this->Target->GetMakefile()->IsConfigured())
+ if (this->GlobalGenerator->GetConfigureDoneCMP0026())
{
this->DebugCompatiblePropertiesDone[p] = true;
}
@@ -4504,7 +4504,7 @@ void cmGeneratorTarget::GetLanguages(std::set<std::string>& languages,
std::vector<cmGeneratorTarget*> objectLibraries;
std::vector<cmSourceFile const*> externalObjects;
- if (!this->Makefile->IsConfigured())
+ if (!this->GlobalGenerator->GetConfigureDoneCMP0026())
{
std::vector<cmTarget*> objectTargets;
this->Target->GetObjectLibrariesCMP0026(objectTargets);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 33b04ac..7aa8bb6 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -72,6 +72,8 @@ cmGlobalGenerator::cmGlobalGenerator(cmake* cm)
this->ExtraGenerator = 0;
this->CurrentMakefile = 0;
this->TryCompileOuterMakefile = 0;
+
+ this->ConfigureDoneCMP0026 = false;
}
cmGlobalGenerator::~cmGlobalGenerator()
@@ -1110,9 +1112,12 @@ void cmGlobalGenerator::Configure()
this->CMakeInstance->GetHomeOutputDirectory());
// now do it
+ this->ConfigureDoneCMP0026 = false;
dirMf->Configure();
dirMf->EnforceDirectoryLevelRules();
+ this->ConfigureDoneCMP0026 = true;
+
// Put a copy of each global target in every directory.
cmTargets globalTargets;
this->CreateDefaultGlobalTargets(&globalTargets);
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 9fc2d45..40f98dc 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -363,6 +363,8 @@ public:
cmFileLockPool& GetFileLockPool() { return FileLockPool; }
#endif
+ bool GetConfigureDoneCMP0026() const { return this->ConfigureDoneCMP0026; }
+
std::string MakeSilentFlag;
protected:
typedef std::vector<cmLocalGenerator*> GeneratorVector;
@@ -520,6 +522,7 @@ protected:
bool ForceUnixPaths;
bool ToolSupportsColor;
bool InstallTargetEnabled;
+ bool ConfigureDoneCMP0026;
};
#endif
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 97a9f1e..4418ead 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2850,7 +2850,7 @@ cmIML_INT_uint64_t cmLocalGenerator::GetBackwardsCompatibility()
}
}
this->BackwardsCompatibility = CMake_VERSION_ENCODE(major, minor, patch);
- this->BackwardsCompatibilityFinal = this->Makefile->IsConfigured();
+ this->BackwardsCompatibilityFinal = true;
}
return this->BackwardsCompatibility;
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 752c8a7..f46c5b9 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -371,7 +371,7 @@ cmNinjaTargetGenerator
mf->GetSafeDefinition("CMAKE_C_COMPILER") :
mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
cldeps = "\"";
- cldeps += mf->GetSafeDefinition("CMAKE_CMCLDEPS_EXECUTABLE");
+ cldeps += cmSystemTools::GetCMClDepsCommand();
cldeps += "\" " + lang + " $in \"$DEP_FILE\" $out \"";
cldeps += mf->GetSafeDefinition("CMAKE_CL_SHOWINCLUDES_PREFIX");
cldeps += "\" \"" + cl + "\" ";
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 005a803..2675066 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2216,6 +2216,7 @@ static std::string cmSystemToolsCTestCommand;
static std::string cmSystemToolsCPackCommand;
static std::string cmSystemToolsCMakeCursesCommand;
static std::string cmSystemToolsCMakeGUICommand;
+static std::string cmSystemToolsCMClDepsCommand;
static std::string cmSystemToolsCMakeRoot;
void cmSystemTools::FindCMakeResources(const char* argv0)
{
@@ -2308,6 +2309,13 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
{
cmSystemToolsCMakeCursesCommand = "";
}
+ cmSystemToolsCMClDepsCommand = exe_dir;
+ cmSystemToolsCMClDepsCommand += "/cmcldeps";
+ cmSystemToolsCMClDepsCommand += cmSystemTools::GetExecutableExtension();
+ if(!cmSystemTools::FileExists(cmSystemToolsCMClDepsCommand.c_str()))
+ {
+ cmSystemToolsCMClDepsCommand = "";
+ }
#ifdef CMAKE_BUILD_WITH_CMAKE
// Install tree has "<prefix>/bin/cmake" and "<prefix><CMAKE_DATA_DIR>".
@@ -2375,6 +2383,12 @@ std::string const& cmSystemTools::GetCMakeGUICommand()
}
//----------------------------------------------------------------------------
+std::string const& cmSystemTools::GetCMClDepsCommand()
+{
+ return cmSystemToolsCMClDepsCommand;
+}
+
+//----------------------------------------------------------------------------
std::string const& cmSystemTools::GetCMakeRoot()
{
return cmSystemToolsCMakeRoot;
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index d14897f..e88170a 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -426,6 +426,7 @@ public:
static std::string const& GetCMakeCommand();
static std::string const& GetCMakeGUICommand();
static std::string const& GetCMakeCursesCommand();
+ static std::string const& GetCMClDepsCommand();
static std::string const& GetCMakeRoot();
/** Echo a message in color using KWSys's Terminal cprintf. */
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 2dfa19c..13e0d7e 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -636,7 +636,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
{
assert(this->GetType() != INTERFACE_LIBRARY);
- if (!this->Makefile->IsConfigured())
+ if (!this->GetMakefile()->GetGlobalGenerator()->GetConfigureDoneCMP0026())
{
// At configure-time, this method can be called as part of getting the
// LOCATION property or to export() a file to be include()d. However
@@ -682,7 +682,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
"SOURCES")
!= debugProperties.end();
- if (this->Makefile->IsConfigured())
+ if (this->GetMakefile()->GetGlobalGenerator()->GetConfigureDoneCMP0026())
{
this->DebugSourcesDone = true;
}
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index afcbd61..7fa6aed 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -46,6 +46,10 @@ static const char * cmDocumentationOptions[][2] =
{"--debug", "Displaying more verbose internals of CTest."},
{"--output-on-failure", "Output anything outputted by the test program "
"if the test should fail."},
+ {"--test-output-size-passed <size>", "Limit the output for passed tests "
+ "to <size> bytes"},
+ {"--test-output-size-failed <size>", "Limit the output for failed tests "
+ "to <size> bytes"},
{"-F", "Enable failover."},
{"-j <jobs>, --parallel <jobs>", "Run the tests in parallel using the "
"given number of jobs."},
diff --git a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
index fc58ea5..6331717 100644
--- a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
@@ -11,3 +11,4 @@ run_cmake(CMP0026-LOCATION-CONFIG-OLD)
run_cmake(CMP0026-LOCATION-CONFIG-WARN)
run_cmake(ObjlibNotDefined)
run_cmake(LOCATION-and-TARGET_OBJECTS)
+run_cmake(clear-cached-information)
diff --git a/Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt b/Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt
new file mode 100644
index 0000000..c51e883
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt
@@ -0,0 +1,2 @@
+
+add_executable(Hello ${CMAKE_CURRENT_BINARY_DIR}/main.c)
diff --git a/Tests/RunCMake/CMP0026/clear-cached-information.cmake b/Tests/RunCMake/CMP0026/clear-cached-information.cmake
new file mode 100644
index 0000000..dd2dd72
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/clear-cached-information.cmake
@@ -0,0 +1,14 @@
+
+enable_language(C)
+
+cmake_policy(SET CMP0026 OLD)
+
+add_subdirectory(clear-cached-information-dir)
+
+# Critical: this needs to happen in root CMakeLists.txt and not inside
+# the subdir.
+get_target_property(mypath Hello LOCATION)
+# Now we create the file later, so you can see, ultimately no error should
+# happen e.g. during generate phase:
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clear-cached-information-dir/main.c)
+set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/clear-cached-information-dir/main.c PROPERTIES GENERATED TRUE)
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index dfc1e33..00895cc 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -108,3 +108,20 @@ run_TestLoad(test-load-invalid 'two')
run_TestLoad(test-load-pass 10)
unset(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING})
+
+function(run_TestOutputSize)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/TestOutputSize)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+ add_test(PassingTest \"${CMAKE_COMMAND}\" -E echo PassingTestOutput)
+ add_test(FailingTest \"${CMAKE_COMMAND}\" -E no_such_command)
+")
+ run_cmake_command(TestOutputSize
+ ${CMAKE_CTEST_COMMAND} -M Experimental -T Test
+ --test-output-size-passed 10
+ --test-output-size-failed 12
+ )
+endfunction()
+run_TestOutputSize()
diff --git a/Tests/RunCMake/CTestCommandLine/TestOutputSize-check.cmake b/Tests/RunCMake/CTestCommandLine/TestOutputSize-check.cmake
new file mode 100644
index 0000000..918d242
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/TestOutputSize-check.cmake
@@ -0,0 +1,17 @@
+file(GLOB test_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Test.xml")
+if(test_xml_file)
+ file(READ "${test_xml_file}" test_xml LIMIT 4096)
+ if("${test_xml}" MATCHES [[(<Test Status="passed">.*</Test>).*(<Test Status="failed">.*</Test>)]])
+ set(test_passed "${CMAKE_MATCH_1}")
+ set(test_failed "${CMAKE_MATCH_2}")
+ else()
+ set(RunCMake_TEST_FAILED "Test.xml does not contain a passed then failed test:\n ${test_xml}")
+ endif()
+ if(NOT "${test_passed}" MATCHES [[<Value>PassingTes\.\.\..*10 bytes]])
+ set(RunCMake_TEST_FAILED "Test.xml passed test output not truncated at 10 bytes:\n ${test_passed}")
+ elseif(NOT "${test_failed}" MATCHES [[<Value>CMake Error:\.\.\..*12 bytes]])
+ set(RunCMake_TEST_FAILED "Test.xml failed test output not truncated at 12 bytes:\n ${test_failed}")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "Test.xml not found")
+endif()
diff --git a/Tests/RunCMake/CTestCommandLine/TestOutputSize-result.txt b/Tests/RunCMake/CTestCommandLine/TestOutputSize-result.txt
new file mode 100644
index 0000000..9c558e3
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/TestOutputSize-result.txt
@@ -0,0 +1 @@
+.
diff --git a/Tests/RunCMake/CTestCommandLine/TestOutputSize-stderr.txt b/Tests/RunCMake/CTestCommandLine/TestOutputSize-stderr.txt
new file mode 100644
index 0000000..ba4235d
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/TestOutputSize-stderr.txt
@@ -0,0 +1 @@
+Errors while running CTest
diff --git a/Tests/RunCMake/ctest_test/CMakeLists.txt.in b/Tests/RunCMake/ctest_test/CMakeLists.txt.in
index cedf379..e61b556 100644
--- a/Tests/RunCMake/ctest_test/CMakeLists.txt.in
+++ b/Tests/RunCMake/ctest_test/CMakeLists.txt.in
@@ -2,3 +2,4 @@ cmake_minimum_required(VERSION 3.1)
project(CTestTest@CASE_NAME@ NONE)
include(CTest)
add_test(NAME RunCMakeVersion COMMAND "${CMAKE_COMMAND}" --version)
+@CASE_CMAKELISTS_SUFFIX_CODE@
diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
index 76dc143..e2f380c 100644
--- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
@@ -59,3 +59,18 @@ function(run_TestChangeId)
run_ctest(TestChangeId)
endfunction()
run_TestChangeId()
+
+function(run_TestOutputSize)
+ set(CASE_CTEST_TEST_ARGS EXCLUDE RunCMakeVersion)
+ set(CASE_TEST_PREFIX_CODE [[
+set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 10)
+set(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 12)
+ ]])
+ set(CASE_CMAKELISTS_SUFFIX_CODE [[
+add_test(NAME PassingTest COMMAND ${CMAKE_COMMAND} -E echo PassingTestOutput)
+add_test(NAME FailingTest COMMAND ${CMAKE_COMMAND} -E no_such_command)
+ ]])
+
+ run_ctest(TestOutputSize)
+endfunction()
+run_TestOutputSize()
diff --git a/Tests/RunCMake/ctest_test/TestOutputSize-check.cmake b/Tests/RunCMake/ctest_test/TestOutputSize-check.cmake
new file mode 100644
index 0000000..918d242
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestOutputSize-check.cmake
@@ -0,0 +1,17 @@
+file(GLOB test_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Test.xml")
+if(test_xml_file)
+ file(READ "${test_xml_file}" test_xml LIMIT 4096)
+ if("${test_xml}" MATCHES [[(<Test Status="passed">.*</Test>).*(<Test Status="failed">.*</Test>)]])
+ set(test_passed "${CMAKE_MATCH_1}")
+ set(test_failed "${CMAKE_MATCH_2}")
+ else()
+ set(RunCMake_TEST_FAILED "Test.xml does not contain a passed then failed test:\n ${test_xml}")
+ endif()
+ if(NOT "${test_passed}" MATCHES [[<Value>PassingTes\.\.\..*10 bytes]])
+ set(RunCMake_TEST_FAILED "Test.xml passed test output not truncated at 10 bytes:\n ${test_passed}")
+ elseif(NOT "${test_failed}" MATCHES [[<Value>CMake Error:\.\.\..*12 bytes]])
+ set(RunCMake_TEST_FAILED "Test.xml failed test output not truncated at 12 bytes:\n ${test_failed}")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "Test.xml not found")
+endif()