diff options
Diffstat (limited to 'Tests')
112 files changed, 469 insertions, 123 deletions
diff --git a/Tests/CMakeGUI/CatchShow.h b/Tests/CMakeGUI/CatchShow.h index 0254c15..7d370b6 100644 --- a/Tests/CMakeGUI/CatchShow.h +++ b/Tests/CMakeGUI/CatchShow.h @@ -30,12 +30,13 @@ void CatchShow::setCallback(F&& func) this->m_callback = [this, func](QObject* obj) { auto* d = qobject_cast<T*>(obj); if (d) { - QMetaObject::invokeMethod(obj, - [this, func, d]() { - ++this->m_count; - func(d); - }, - Qt::QueuedConnection); + QMetaObject::invokeMethod( + obj, + [this, func, d]() { + ++this->m_count; + func(d); + }, + Qt::QueuedConnection); } }; } diff --git a/Tests/CMakeLib/testArgumentParser.cxx b/Tests/CMakeLib/testArgumentParser.cxx index e044794..2647fef 100644 --- a/Tests/CMakeLib/testArgumentParser.cxx +++ b/Tests/CMakeLib/testArgumentParser.cxx @@ -365,7 +365,7 @@ bool testArgumentParserStaticBool() } // namespace -int testArgumentParser(int /*unused*/, char* /*unused*/ []) +int testArgumentParser(int /*unused*/, char* /*unused*/[]) { if (!testArgumentParserDynamic()) { std::cout << "While executing testArgumentParserDynamic().\n"; diff --git a/Tests/CMakeLib/testCMExtAlgorithm.cxx b/Tests/CMakeLib/testCMExtAlgorithm.cxx index b8319c3..c909f24 100644 --- a/Tests/CMakeLib/testCMExtAlgorithm.cxx +++ b/Tests/CMakeLib/testCMExtAlgorithm.cxx @@ -110,7 +110,7 @@ void testAppend() } } -int testCMExtAlgorithm(int /*unused*/, char* /*unused*/ []) +int testCMExtAlgorithm(int /*unused*/, char* /*unused*/[]) { testAppend(); diff --git a/Tests/CMakeLib/testCMExtEnumSet.cxx b/Tests/CMakeLib/testCMExtEnumSet.cxx index dbb0a54..ecf6d11 100644 --- a/Tests/CMakeLib/testCMExtEnumSet.cxx +++ b/Tests/CMakeLib/testCMExtEnumSet.cxx @@ -203,7 +203,7 @@ void testEdition() } } -int testCMExtEnumSet(int /*unused*/, char* /*unused*/ []) +int testCMExtEnumSet(int /*unused*/, char* /*unused*/[]) { testDeclaration(); testIteration(); diff --git a/Tests/CMakeLib/testCMExtMemory.cxx b/Tests/CMakeLib/testCMExtMemory.cxx index d8932ce..0143515 100644 --- a/Tests/CMakeLib/testCMExtMemory.cxx +++ b/Tests/CMakeLib/testCMExtMemory.cxx @@ -55,7 +55,7 @@ bool testReferenceCast() } } -int testCMExtMemory(int /*unused*/, char* /*unused*/ []) +int testCMExtMemory(int /*unused*/, char* /*unused*/[]) { if (!testReferenceCast()) { return 1; diff --git a/Tests/CMakeLib/testCMFilesystemPath.cxx b/Tests/CMakeLib/testCMFilesystemPath.cxx index 579ba99..52cb43a 100644 --- a/Tests/CMakeLib/testCMFilesystemPath.cxx +++ b/Tests/CMakeLib/testCMFilesystemPath.cxx @@ -969,7 +969,7 @@ bool testNonMemberFunctions() } } -int testCMFilesystemPath(int /*unused*/, char* /*unused*/ []) +int testCMFilesystemPath(int /*unused*/, char* /*unused*/[]) { int result = 0; diff --git a/Tests/CMakeLib/testCTestBinPacker.cxx b/Tests/CMakeLib/testCTestBinPacker.cxx index 772f417..038ceea 100644 --- a/Tests/CMakeLib/testCTestBinPacker.cxx +++ b/Tests/CMakeLib/testCTestBinPacker.cxx @@ -275,7 +275,7 @@ static bool TestExpectedPackResult(const ExpectedPackResult& expected) return true; } -int testCTestBinPacker(int /*unused*/, char* /*unused*/ []) +int testCTestBinPacker(int /*unused*/, char* /*unused*/[]) { int retval = 0; diff --git a/Tests/CMakeLib/testCTestResourceGroups.cxx b/Tests/CMakeLib/testCTestResourceGroups.cxx index 776d65d..b68301f 100644 --- a/Tests/CMakeLib/testCTestResourceGroups.cxx +++ b/Tests/CMakeLib/testCTestResourceGroups.cxx @@ -127,7 +127,7 @@ static bool TestExpectedParseResult(const ExpectedParseResult& expected) return true; } -int testCTestResourceGroups(int /*unused*/, char* /*unused*/ []) +int testCTestResourceGroups(int /*unused*/, char* /*unused*/[]) { int retval = 0; diff --git a/Tests/CMakeLib/testFindPackageCommand.cxx b/Tests/CMakeLib/testFindPackageCommand.cxx index bfd429f..30749be 100644 --- a/Tests/CMakeLib/testFindPackageCommand.cxx +++ b/Tests/CMakeLib/testFindPackageCommand.cxx @@ -14,7 +14,7 @@ std::cout << "FAILED: " << (m) << "\n"; \ failed = 1 -int testFindPackageCommand(int /*unused*/, char* /*unused*/ []) +int testFindPackageCommand(int /*unused*/, char* /*unused*/[]) { int failed = 0; diff --git a/Tests/CMakeLib/testGeneratedFileStream.cxx b/Tests/CMakeLib/testGeneratedFileStream.cxx index de44a0b..ad1c9e5 100644 --- a/Tests/CMakeLib/testGeneratedFileStream.cxx +++ b/Tests/CMakeLib/testGeneratedFileStream.cxx @@ -10,7 +10,7 @@ std::cout << "FAILED: " << (m1) << (m2) << "\n"; \ failed = 1 -int testGeneratedFileStream(int /*unused*/, char* /*unused*/ []) +int testGeneratedFileStream(int /*unused*/, char* /*unused*/[]) { int failed = 0; cmGeneratedFileStream gm; diff --git a/Tests/CMakeLib/testJSONHelpers.cxx b/Tests/CMakeLib/testJSONHelpers.cxx index 2cd3f75..053c163 100644 --- a/Tests/CMakeLib/testJSONHelpers.cxx +++ b/Tests/CMakeLib/testJSONHelpers.cxx @@ -457,7 +457,7 @@ bool testRequired() } } -int testJSONHelpers(int /*unused*/, char* /*unused*/ []) +int testJSONHelpers(int /*unused*/, char* /*unused*/[]) { if (!testInt()) { return 1; diff --git a/Tests/CMakeLib/testOptional.cxx b/Tests/CMakeLib/testOptional.cxx index 2007fff..785f031 100644 --- a/Tests/CMakeLib/testOptional.cxx +++ b/Tests/CMakeLib/testOptional.cxx @@ -760,7 +760,7 @@ static bool testMemoryRange(std::vector<Event>& expected) return true; } -int testOptional(int /*unused*/, char* /*unused*/ []) +int testOptional(int /*unused*/, char* /*unused*/[]) { int retval = 0; diff --git a/Tests/CMakeLib/testRange.cxx b/Tests/CMakeLib/testRange.cxx index 4efe98e..36c1e18 100644 --- a/Tests/CMakeLib/testRange.cxx +++ b/Tests/CMakeLib/testRange.cxx @@ -15,7 +15,7 @@ } \ } while (false) -int testRange(int /*unused*/, char* /*unused*/ []) +int testRange(int /*unused*/, char* /*unused*/[]) { std::vector<int> const testData = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; diff --git a/Tests/CMakeLib/testString.cxx b/Tests/CMakeLib/testString.cxx index 5a9cad1..af34a2f 100644 --- a/Tests/CMakeLib/testString.cxx +++ b/Tests/CMakeLib/testString.cxx @@ -1163,7 +1163,7 @@ static bool testStability() return true; } -int testString(int /*unused*/, char* /*unused*/ []) +int testString(int /*unused*/, char* /*unused*/[]) { if (!testConstructDefault()) { return 1; diff --git a/Tests/CMakeLib/testStringAlgorithms.cxx b/Tests/CMakeLib/testStringAlgorithms.cxx index cb5f886..1bb23df 100644 --- a/Tests/CMakeLib/testStringAlgorithms.cxx +++ b/Tests/CMakeLib/testStringAlgorithms.cxx @@ -14,7 +14,7 @@ #include "cmStringAlgorithms.h" -int testStringAlgorithms(int /*unused*/, char* /*unused*/ []) +int testStringAlgorithms(int /*unused*/, char* /*unused*/[]) { int failed = 0; diff --git a/Tests/CMakeLib/testSystemTools.cxx b/Tests/CMakeLib/testSystemTools.cxx index 92f5275..754205e 100644 --- a/Tests/CMakeLib/testSystemTools.cxx +++ b/Tests/CMakeLib/testSystemTools.cxx @@ -25,7 +25,7 @@ } \ } while (false) -int testSystemTools(int /*unused*/, char* /*unused*/ []) +int testSystemTools(int /*unused*/, char* /*unused*/[]) { int failed = 0; // ---------------------------------------------------------------------- diff --git a/Tests/CMakeLib/testUTF8.cxx b/Tests/CMakeLib/testUTF8.cxx index 1bf88cf..fc0b539 100644 --- a/Tests/CMakeLib/testUTF8.cxx +++ b/Tests/CMakeLib/testUTF8.cxx @@ -164,7 +164,7 @@ static bool is_invalid(const char* s) return true; } -int testUTF8(int /*unused*/, char* /*unused*/ []) +int testUTF8(int /*unused*/, char* /*unused*/[]) { int result = 0; for (test_utf8_entry const* e = good_entry; e->n; ++e) { diff --git a/Tests/CMakeLib/testUVRAII.cxx b/Tests/CMakeLib/testUVRAII.cxx index fd88e24..0bdd44c 100644 --- a/Tests/CMakeLib/testUVRAII.cxx +++ b/Tests/CMakeLib/testUVRAII.cxx @@ -30,8 +30,7 @@ static bool testAsyncShutdown() std::thread([&] { std::this_thread::sleep_for(std::chrono::seconds(2)); signal.send(); - }) - .detach(); + }).detach(); if (uv_run(&Loop, UV_RUN_DEFAULT) != 0) { std::cerr << "Unclean exit state in testAsyncDtor" << std::endl; diff --git a/Tests/CMakeLib/testUVStreambuf.cxx b/Tests/CMakeLib/testUVStreambuf.cxx index 760fa29..f9ed6af 100644 --- a/Tests/CMakeLib/testUVStreambuf.cxx +++ b/Tests/CMakeLib/testUVStreambuf.cxx @@ -404,12 +404,13 @@ static bool testUVStreambufRead( << std::endl; goto end; } - uv_timer_start(timer, - [](uv_timer_t* handle) { - auto buf = static_cast<cmUVStreambuf*>(handle->data); - buf->close(); - }, - 0, 0); + uv_timer_start( + timer, + [](uv_timer_t* handle) { + auto buf = static_cast<cmUVStreambuf*>(handle->data); + buf->close(); + }, + 0, 0); if ((readLen = inputBuf.sgetn(inputData.data(), 128)) != 0) { std::cout << "sgetn() returned " << readLen << ", should be 0" << std::endl; diff --git a/Tests/CMakeLib/testVisualStudioSlnParser.cxx b/Tests/CMakeLib/testVisualStudioSlnParser.cxx index 7fdba9a..c1bf3d4 100644 --- a/Tests/CMakeLib/testVisualStudioSlnParser.cxx +++ b/Tests/CMakeLib/testVisualStudioSlnParser.cxx @@ -27,7 +27,7 @@ static bool parsedRight(cmVisualStudioSlnParser& parser, return false; } -int testVisualStudioSlnParser(int, char* []) +int testVisualStudioSlnParser(int, char*[]) { cmVisualStudioSlnParser parser; diff --git a/Tests/CMakeLib/testXMLParser.cxx b/Tests/CMakeLib/testXMLParser.cxx index 8617cc1..32ee3ec 100644 --- a/Tests/CMakeLib/testXMLParser.cxx +++ b/Tests/CMakeLib/testXMLParser.cxx @@ -4,7 +4,7 @@ #include "cmXMLParser.h" -int testXMLParser(int /*unused*/, char* /*unused*/ []) +int testXMLParser(int /*unused*/, char* /*unused*/[]) { // TODO: Derive from parser and check attributes. cmXMLParser parser; diff --git a/Tests/CMakeLib/testXMLSafe.cxx b/Tests/CMakeLib/testXMLSafe.cxx index dc62eb9..f0bd9c9 100644 --- a/Tests/CMakeLib/testXMLSafe.cxx +++ b/Tests/CMakeLib/testXMLSafe.cxx @@ -25,7 +25,7 @@ static test_pair const pairs[] = { { nullptr, nullptr } }; -int testXMLSafe(int /*unused*/, char* /*unused*/ []) +int testXMLSafe(int /*unused*/, char* /*unused*/[]) { int result = 0; for (test_pair const* p = pairs; p->in; ++p) { diff --git a/Tests/CSharpLinkFromCxx/.gitattributes b/Tests/CSharpLinkFromCxx/.gitattributes index cf9d355..57a39049 100644 --- a/Tests/CSharpLinkFromCxx/.gitattributes +++ b/Tests/CSharpLinkFromCxx/.gitattributes @@ -1 +1 @@ -UsefulManagedCppClass.* -format.clang-format-6.0 +UsefulManagedCppClass.* -format.clang-format diff --git a/Tests/CheckFortran.cmake b/Tests/CheckFortran.cmake index 36293f5..1e943a1 100644 --- a/Tests/CheckFortran.cmake +++ b/Tests/CheckFortran.cmake @@ -33,6 +33,7 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" RESULT_VARIABLE result ) include(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CheckFortran/result.cmake OPTIONAL) + # FIXME: Replace with message(CONFIGURE_LOG) when CMake version is high enough. if(CMAKE_Fortran_COMPILER AND "${result}" STREQUAL "0") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "${_desc} passed with the following output:\n" diff --git a/Tests/CheckSwift.cmake b/Tests/CheckSwift.cmake index 099c298..86ea603 100644 --- a/Tests/CheckSwift.cmake +++ b/Tests/CheckSwift.cmake @@ -42,6 +42,7 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" include(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CheckSwift/result.cmake OPTIONAL) + # FIXME: Replace with message(CONFIGURE_LOG) when CMake version is high enough. if(CMAKE_Swift_COMPILER AND "${result}" STREQUAL "0") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "${_desc} passed with the following output:\n" diff --git a/Tests/CompileFeatures/.gitattributes b/Tests/CompileFeatures/.gitattributes index 95a8956..83da28d 100644 --- a/Tests/CompileFeatures/.gitattributes +++ b/Tests/CompileFeatures/.gitattributes @@ -1,2 +1,2 @@ # Do not format a source containing C++11 '>>' syntax as C++98. -cxx_right_angle_brackets.cpp -format.clang-format-6.0 +cxx_right_angle_brackets.cpp -format.clang-format diff --git a/Tests/CompileFeatures/cxx_attribute_deprecated.cpp b/Tests/CompileFeatures/cxx_attribute_deprecated.cpp index 8faeca8..5482db8 100644 --- a/Tests/CompileFeatures/cxx_attribute_deprecated.cpp +++ b/Tests/CompileFeatures/cxx_attribute_deprecated.cpp @@ -1,5 +1,8 @@ -[[deprecated]] int foo() { return 0; } +[[deprecated]] int foo() +{ + return 0; +} int someFunc() { diff --git a/Tests/CompileFeatures/cxx_attributes.cpp b/Tests/CompileFeatures/cxx_attributes.cpp index 1434317..543a3f5 100644 --- a/Tests/CompileFeatures/cxx_attributes.cpp +++ b/Tests/CompileFeatures/cxx_attributes.cpp @@ -1,5 +1,5 @@ -void unusedFunc[[noreturn]]() +void unusedFunc [[noreturn]] () { throw 1; } diff --git a/Tests/Cuda/SeparableCompCXXOnly/main.cpp b/Tests/Cuda/SeparableCompCXXOnly/main.cpp index 8135246..ed913ff 100644 --- a/Tests/Cuda/SeparableCompCXXOnly/main.cpp +++ b/Tests/Cuda/SeparableCompCXXOnly/main.cpp @@ -1,5 +1,5 @@ -int main(int, char const* []) +int main(int, char const*[]) { return 0; } diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt index 17069e3..ca73b1a 100644 --- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt +++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt @@ -15,6 +15,9 @@ get_property(sep_comp TARGET CUDASeparateLibA PROPERTY CUDA_SEPARABLE_COMPILATIO if(NOT sep_comp) message(FATAL_ERROR "CUDA_SEPARABLE_COMPILATION not initialized") endif() +set_target_properties(CUDASeparateLibA + PROPERTIES + POSITION_INDEPENDENT_CODE ON) unset(CMAKE_CUDA_SEPARABLE_COMPILATION) if(CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC") @@ -26,17 +29,24 @@ if(CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC") target_compile_options(CUDASeparateLibA PRIVATE -Xcompiler=-bigobj) endif() -#Having file4/file5 in a shared library causes serious problems -#with the nvcc linker and it will generate bad entries that will -#cause a segv when trying to run the executable +#Have file4 and file5 in different shared libraries so that we +#verify that hidden visibility is passed to the device linker. +#Otherwise we will get a segv when trying to run the executable # -add_library(CUDASeparateLibB STATIC file4.cu file5.cu) +add_library(CUDASeparateLibB SHARED file4.cu) target_compile_features(CUDASeparateLibB PRIVATE cuda_std_11) target_link_libraries(CUDASeparateLibB PRIVATE CUDASeparateLibA) -set_target_properties(CUDASeparateLibA - CUDASeparateLibB - PROPERTIES CUDA_SEPARABLE_COMPILATION ON - POSITION_INDEPENDENT_CODE ON) +add_library(CUDASeparateLibC SHARED file5.cu) +target_compile_features(CUDASeparateLibC PRIVATE cuda_std_11) +target_link_libraries(CUDASeparateLibC PRIVATE CUDASeparateLibA) + +set_target_properties(CUDASeparateLibB + CUDASeparateLibC + PROPERTIES + CUDA_SEPARABLE_COMPILATION ON + POSITION_INDEPENDENT_CODE ON + CUDA_VISIBILITY_PRESET hidden + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/main") add_subdirectory(main) diff --git a/Tests/CudaOnly/SeparateCompilation/file1.h b/Tests/CudaOnly/SeparateCompilation/file1.h index ff1945c..1cedc20 100644 --- a/Tests/CudaOnly/SeparateCompilation/file1.h +++ b/Tests/CudaOnly/SeparateCompilation/file1.h @@ -1,5 +1,14 @@ #pragma once + +#ifdef _WIN32 +# define EXPORT __declspec(dllexport) +# define IMPORT __declspec(dllimport) +#else +# define EXPORT __attribute__((__visibility__("default"))) +# define IMPORT +#endif + struct result_type { int input; diff --git a/Tests/CudaOnly/SeparateCompilation/file4.cu b/Tests/CudaOnly/SeparateCompilation/file4.cu index 2e3e01e..cc24a46 100644 --- a/Tests/CudaOnly/SeparateCompilation/file4.cu +++ b/Tests/CudaOnly/SeparateCompilation/file4.cu @@ -15,7 +15,7 @@ static __global__ void file4_kernel(result_type& r, int x) result_type_dynamic rd = file2_func(x); } -int file4_launch_kernel(int x) +EXPORT int file4_launch_kernel(int x) { result_type r; file4_kernel<<<1, 1>>>(r, x); diff --git a/Tests/CudaOnly/SeparateCompilation/file5.cu b/Tests/CudaOnly/SeparateCompilation/file5.cu index fee8e9e..38cbeb2 100644 --- a/Tests/CudaOnly/SeparateCompilation/file5.cu +++ b/Tests/CudaOnly/SeparateCompilation/file5.cu @@ -15,7 +15,7 @@ static __global__ void file5_kernel(result_type& r, int x) result_type_dynamic rd = file2_func(x); } -int file5_launch_kernel(int x) +EXPORT int file5_launch_kernel(int x) { result_type r; file5_kernel<<<1, 1>>>(r, x); diff --git a/Tests/CudaOnly/SeparateCompilation/main/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/main/CMakeLists.txt index c181078..ce066c6 100644 --- a/Tests/CudaOnly/SeparateCompilation/main/CMakeLists.txt +++ b/Tests/CudaOnly/SeparateCompilation/main/CMakeLists.txt @@ -1,5 +1,5 @@ add_executable(CudaOnlySeparateCompilation main.cu) -target_link_libraries(CudaOnlySeparateCompilation PRIVATE CUDASeparateLibB) +target_link_libraries(CudaOnlySeparateCompilation PRIVATE CUDASeparateLibB CUDASeparateLibC) set_target_properties(CudaOnlySeparateCompilation PROPERTIES CUDA_STANDARD 11 CUDA_STANDARD_REQUIRED TRUE diff --git a/Tests/CudaOnly/SeparateCompilation/main/main.cu b/Tests/CudaOnly/SeparateCompilation/main/main.cu index 2b6e8f4..c3f7ce7 100644 --- a/Tests/CudaOnly/SeparateCompilation/main/main.cu +++ b/Tests/CudaOnly/SeparateCompilation/main/main.cu @@ -4,8 +4,8 @@ #include "../file1.h" #include "../file2.h" -int file4_launch_kernel(int x); -int file5_launch_kernel(int x); +IMPORT int file4_launch_kernel(int x); +IMPORT int file5_launch_kernel(int x); int choose_cuda_device() { diff --git a/Tests/FindOpenACC/CXXTest/main.cxx b/Tests/FindOpenACC/CXXTest/main.cxx index 7369045..14b912b 100644 --- a/Tests/FindOpenACC/CXXTest/main.cxx +++ b/Tests/FindOpenACC/CXXTest/main.cxx @@ -8,7 +8,7 @@ void vecaddgpu(float* r, float* a, float* b, std::size_t n) r[i] = a[i] + b[i]; } -int main(int, char* []) +int main(int, char*[]) { const std::size_t n = 100000; /* vector length */ std::vector<float> a(n); /* input vector 1 */ diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt index b07c214..fc71a18 100644 --- a/Tests/FortranOnly/CMakeLists.txt +++ b/Tests/FortranOnly/CMakeLists.txt @@ -56,8 +56,6 @@ add_custom_target(checksayhello ALL ) add_dependencies(checksayhello sayhello) -set(err_log ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log) -file(REMOVE "${err_log}") include(CheckFortranSourceCompiles) unset(HAVE_PRINT CACHE) CHECK_Fortran_SOURCE_COMPILES([[ @@ -66,10 +64,24 @@ CHECK_Fortran_SOURCE_COMPILES([[ END ]] HAVE_PRINT) if(NOT HAVE_PRINT) - if(EXISTS "${err_log}") - file(READ "${err_log}" err) + set(configure_log "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeConfigureLog.yaml") + if(EXISTS "${configure_log}") + file(READ "${configure_log}" log_content) + else() + set(log_content "") + endif() + if(log_content MATCHES [[( - + kind: "try_compile-v1"( ++ [^ +]+)+ + checks: + - "Performing Test HAVE_PRINT"( ++ [^ +]+)+)]]) + set(err "${CMAKE_MATCH_1}") + else() + set(err "") endif() - string(REPLACE "\n" "\n " err " ${err}") message(SEND_ERROR "CHECK_Fortran_SOURCE_COMPILES for HAVE_PRINT failed:\n" "${err}") endif() diff --git a/Tests/PositionIndependentTargets/.gitattributes b/Tests/PositionIndependentTargets/.gitattributes index 61b2751..ed36631 100644 --- a/Tests/PositionIndependentTargets/.gitattributes +++ b/Tests/PositionIndependentTargets/.gitattributes @@ -1,2 +1,2 @@ # Do not format a source where we want a long line preserved. -pic_test.h -format.clang-format-6.0 +pic_test.h -format.clang-format diff --git a/Tests/QtAutogen/Complex/calwidget.cpp b/Tests/QtAutogen/Complex/calwidget.cpp index f58b182..202ed49 100644 --- a/Tests/QtAutogen/Complex/calwidget.cpp +++ b/Tests/QtAutogen/Complex/calwidget.cpp @@ -433,4 +433,4 @@ QComboBox* Window::createColorComboBox() return comboBox; } -//#include "moc_calwidget.cpp" +// #include "moc_calwidget.cpp" diff --git a/Tests/RunCMake/CMakePresets/NoDebug-stdout.txt b/Tests/RunCMake/CMakePresets/NoDebug-stdout.txt index c23ab89..f32056a 100644 --- a/Tests/RunCMake/CMakePresets/NoDebug-stdout.txt +++ b/Tests/RunCMake/CMakePresets/NoDebug-stdout.txt @@ -1,2 +1,2 @@ --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) diff --git a/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt index 55bb894..da548a6 100644 --- a/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt +++ b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt @@ -1,2 +1 @@ -- Configuring incomplete, errors occurred! -See also ".*/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-build/CMakeFiles/CMakeOutput\.log". diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index 8c35fe5..bda260a 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -389,6 +389,14 @@ function(run_NoTests) run_cmake_command(no-tests_error ${CMAKE_CTEST_COMMAND} --no-tests=error) run_cmake_command(no-tests_bad ${CMAKE_CTEST_COMMAND} --no-tests=bad) run_cmake_command(no-tests_legacy ${CMAKE_CTEST_COMMAND}) + + run_cmake_command(no-tests_env_ignore ${CMAKE_COMMAND} -E env CTEST_NO_TESTS_ACTION=ignore ${CMAKE_CTEST_COMMAND}) + run_cmake_command(no-tests_env_error ${CMAKE_COMMAND} -E env CTEST_NO_TESTS_ACTION=error ${CMAKE_CTEST_COMMAND}) + run_cmake_command(no-tests_env_bad ${CMAKE_COMMAND} -E env CTEST_NO_TESTS_ACTION=bad ${CMAKE_CTEST_COMMAND}) + run_cmake_command(no-tests_env_empty_legacy ${CMAKE_COMMAND} -E env CTEST_NO_TESTS_ACTION= ${CMAKE_CTEST_COMMAND}) + + run_cmake_command(no-tests_env_bad_with_cli_error ${CMAKE_COMMAND} -E env CTEST_NO_TESTS_ACTION=bad ${CMAKE_CTEST_COMMAND} --no-tests=error) + file(WRITE "${RunCMake_TEST_BINARY_DIR}/NoTestsScript.cmake" " set(CTEST_COMMAND \"${CMAKE_CTEST_COMMAND}\") set(CTEST_SOURCE_DIRECTORY \"${RunCMake_SOURCE_DIR}\") diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_env_bad-result.txt b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_env_bad-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad-stderr.txt new file mode 100644 index 0000000..97187e6 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad-stderr.txt @@ -0,0 +1 @@ +^Unknown value for CTEST_NO_TESTS_ACTION: 'bad'$ diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_env_bad_with_cli_error-result.txt b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad_with_cli_error-result.txt new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad_with_cli_error-result.txt @@ -0,0 +1 @@ +8 diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_env_bad_with_cli_error-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad_with_cli_error-stderr.txt new file mode 100644 index 0000000..eafba1c --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests_env_bad_with_cli_error-stderr.txt @@ -0,0 +1 @@ +No tests were found!!! diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_env_empty_legacy-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests_env_empty_legacy-stderr.txt new file mode 100644 index 0000000..a7c4b11 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests_env_empty_legacy-stderr.txt @@ -0,0 +1 @@ +^No tests were found!!!$ diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_env_error-result.txt b/Tests/RunCMake/CTestCommandLine/no-tests_env_error-result.txt new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests_env_error-result.txt @@ -0,0 +1 @@ +8 diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_env_error-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests_env_error-stderr.txt new file mode 100644 index 0000000..eafba1c --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests_env_error-stderr.txt @@ -0,0 +1 @@ +No tests were found!!! diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx b/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx index b872ae9..3b3d313 100644 --- a/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx +++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx @@ -1,5 +1,5 @@ export module importable; -import : internal_partition; +import :internal_partition; #include "internal-partitions_export.h" diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx b/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx index b15f53c..c828612 100644 --- a/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx +++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx @@ -1,4 +1,4 @@ -module importable : internal_partition; +module importable:internal_partition; int from_partition() { diff --git a/Tests/RunCMake/CXXModules/examples/partitions/importable.cxx b/Tests/RunCMake/CXXModules/examples/partitions/importable.cxx index d0ac2f4..fbd5f90 100644 --- a/Tests/RunCMake/CXXModules/examples/partitions/importable.cxx +++ b/Tests/RunCMake/CXXModules/examples/partitions/importable.cxx @@ -1,5 +1,5 @@ export module importable; -export import : partition; +export import :partition; #include "partitions_export.h" diff --git a/Tests/RunCMake/CXXModules/examples/partitions/partition.cxx b/Tests/RunCMake/CXXModules/examples/partitions/partition.cxx index a47a4fd..20131cf 100644 --- a/Tests/RunCMake/CXXModules/examples/partitions/partition.cxx +++ b/Tests/RunCMake/CXXModules/examples/partitions/partition.cxx @@ -1,4 +1,4 @@ -export module importable : partition; +export module importable:partition; #include "partitions_export.h" diff --git a/Tests/RunCMake/CXXModules/sources/module-internal-part-impl.cxx b/Tests/RunCMake/CXXModules/sources/module-internal-part-impl.cxx index be77b0d..cab19ec 100644 --- a/Tests/RunCMake/CXXModules/sources/module-internal-part-impl.cxx +++ b/Tests/RunCMake/CXXModules/sources/module-internal-part-impl.cxx @@ -1,6 +1,6 @@ #ifdef _MSC_VER // Only MSVC supports this pattern. -module M : internal_part; +module M:internal_part; #else module M; #endif diff --git a/Tests/RunCMake/CXXModules/sources/module-internal-part.cxx b/Tests/RunCMake/CXXModules/sources/module-internal-part.cxx index fa82afb..0dc749f 100644 --- a/Tests/RunCMake/CXXModules/sources/module-internal-part.cxx +++ b/Tests/RunCMake/CXXModules/sources/module-internal-part.cxx @@ -1,3 +1,3 @@ -module M : internal_part; +module M:internal_part; int i(); diff --git a/Tests/RunCMake/CXXModules/sources/module-part-impl.cxx b/Tests/RunCMake/CXXModules/sources/module-part-impl.cxx index 46d5d9f..f3b6ba8 100644 --- a/Tests/RunCMake/CXXModules/sources/module-part-impl.cxx +++ b/Tests/RunCMake/CXXModules/sources/module-part-impl.cxx @@ -1,11 +1,11 @@ #ifdef _MSC_VER // Only MSVC supports this pattern. -module M : part; +module M:part; #else module M; #endif -import M : internal_part; +import M:internal_part; int p() { diff --git a/Tests/RunCMake/CXXModules/sources/module-part.cxx b/Tests/RunCMake/CXXModules/sources/module-part.cxx index 137c16f..307781b 100644 --- a/Tests/RunCMake/CXXModules/sources/module-part.cxx +++ b/Tests/RunCMake/CXXModules/sources/module-part.cxx @@ -1,3 +1,3 @@ -export module M : part; +export module M:part; int p(); diff --git a/Tests/RunCMake/CXXModules/sources/module.cxx b/Tests/RunCMake/CXXModules/sources/module.cxx index a631354..37eedeb 100644 --- a/Tests/RunCMake/CXXModules/sources/module.cxx +++ b/Tests/RunCMake/CXXModules/sources/module.cxx @@ -1,5 +1,5 @@ export module M; -export import M : part; -import M : internal_part; +export import M:part; +import M:internal_part; int f(); diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 480ad09..f48e845 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -594,6 +594,15 @@ unset(in) unset(out) set(in ${RunCMake_SOURCE_DIR}/copy_input) +set(out ${RunCMake_BINARY_DIR}/copy_directory_different_output) +file(REMOVE_RECURSE "${out}") +file(MAKE_DIRECTORY ${out}) +run_cmake_command(E_copy_directory_if_different + ${CMAKE_COMMAND} -E copy_directory_if_different ${in} ${out}) +unset(in) +unset(out) + +set(in ${RunCMake_SOURCE_DIR}/copy_input) set(out ${RunCMake_BINARY_DIR}/copy_directory_output) set(outfile ${out}/file_for_test.txt) file(REMOVE_RECURSE "${out}") diff --git a/Tests/RunCMake/CommandLine/cmake_depends/.gitattributes b/Tests/RunCMake/CommandLine/cmake_depends/.gitattributes index d9a4db4..9c22288 100644 --- a/Tests/RunCMake/CommandLine/cmake_depends/.gitattributes +++ b/Tests/RunCMake/CommandLine/cmake_depends/.gitattributes @@ -1,2 +1,2 @@ # Do not format a source encoded in UTF-16. -test_UTF-16LE.h -format.clang-format-6.0 +test_UTF-16LE.h -format.clang-format diff --git a/Tests/RunCMake/CommandLine/cmake_depends/test.c b/Tests/RunCMake/CommandLine/cmake_depends/test.c index 92c056f..5b42255 100644 --- a/Tests/RunCMake/CommandLine/cmake_depends/test.c +++ b/Tests/RunCMake/CommandLine/cmake_depends/test.c @@ -1,2 +1,3 @@ #include "test.h" + #include "test_UTF-16LE.h" diff --git a/Tests/RunCMake/Configure/CopyFileABI-stdout.txt b/Tests/RunCMake/Configure/CopyFileABI-stdout.txt index 6a856a4..2176554 100644 --- a/Tests/RunCMake/Configure/CopyFileABI-stdout.txt +++ b/Tests/RunCMake/Configure/CopyFileABI-stdout.txt @@ -1,4 +1,4 @@ -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done.* --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) diff --git a/Tests/RunCMake/Configure/ErrorLogs-stderr.txt b/Tests/RunCMake/Configure/ErrorLogs-stderr.txt index 4eee45d..ec8c8c2 100644 --- a/Tests/RunCMake/Configure/ErrorLogs-stderr.txt +++ b/Tests/RunCMake/Configure/ErrorLogs-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at ErrorLogs.cmake:3 \(message\): +CMake Error at ErrorLogs.cmake:[0-9]+ \(message\): Some error! Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/Configure/ErrorLogs.cmake b/Tests/RunCMake/Configure/ErrorLogs.cmake index e8cf062..3a9d107 100644 --- a/Tests/RunCMake/Configure/ErrorLogs.cmake +++ b/Tests/RunCMake/Configure/ErrorLogs.cmake @@ -1,3 +1,5 @@ +file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Some detailed output information!\n") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Some detailed error information!\n") message(SEND_ERROR "Some error!") diff --git a/Tests/RunCMake/FileAPI/configureLog-v1-check.py b/Tests/RunCMake/FileAPI/configureLog-v1-check.py index ea5beb4..05c7893 100644 --- a/Tests/RunCMake/FileAPI/configureLog-v1-check.py +++ b/Tests/RunCMake/FileAPI/configureLog-v1-check.py @@ -14,7 +14,7 @@ def check_object_configureLog(o): assert os.path.exists(path) eventKindNames = o["eventKindNames"] assert is_list(eventKindNames) - assert sorted(eventKindNames) == ["try_compile-v1", "try_run-v1"] + assert sorted(eventKindNames) == ["message-v1", "try_compile-v1", "try_run-v1"] assert is_dict(index) assert sorted(index.keys()) == ["cmake", "objects", "reply"] diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-stderr.txt index 013c4f2..9af0573 100644 --- a/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-stderr.txt +++ b/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-stderr.txt @@ -1,5 +1,5 @@ CMake Error at OUTPUT_NAME-recursion.cmake:[0-9]+ \(add_executable\): - Target 'empty2' OUTPUT_NAME depends on itself. + Target 'empty1' OUTPUT_NAME depends on itself. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GenerateExportHeader/reference/.gitattributes b/Tests/RunCMake/GenerateExportHeader/reference/.gitattributes index d9b566e..883a7f1 100644 --- a/Tests/RunCMake/GenerateExportHeader/reference/.gitattributes +++ b/Tests/RunCMake/GenerateExportHeader/reference/.gitattributes @@ -1,2 +1,2 @@ # Exclude reference content from formatting. -* -format.clang-format-6.0 +* -format.clang-format diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-config-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-config-ninja-stdout.txt index 8877451..8c1c301 100644 --- a/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-config-ninja-stdout.txt +++ b/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-config-ninja-stdout.txt @@ -1,4 +1,4 @@ --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) -- Build files have been written to: [^ ]*/Tests/RunCMake/NinjaMultiConfig/Simple-build diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-noconfig-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-noconfig-ninja-stdout.txt index 8877451..8c1c301 100644 --- a/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-noconfig-ninja-stdout.txt +++ b/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-noconfig-ninja-stdout.txt @@ -1,4 +1,4 @@ --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) -- Build files have been written to: [^ ]*/Tests/RunCMake/NinjaMultiConfig/Simple-build diff --git a/Tests/RunCMake/ParseImplicitData/hand-C-relative.input b/Tests/RunCMake/ParseImplicitData/hand-C-relative.input index 52ac9df..dd0c10b 100644 --- a/Tests/RunCMake/ParseImplicitData/hand-C-relative.input +++ b/Tests/RunCMake/ParseImplicitData/hand-C-relative.input @@ -16,8 +16,8 @@ This is a hand-written test case. #include "..." search starts here: #include <...> search starts here: /usr/local/include - ../../../adaptive/relative/include + ../../../../adaptive/relative/include /usr/include End of search list. -/usr/bin/ld -L/usr/lib64 -L../../../adaptive/relative/lib +/usr/bin/ld -L/usr/lib64 -L../../../../adaptive/relative/lib diff --git a/Tests/RunCMake/ParseImplicitData/hand-CXX-relative.input b/Tests/RunCMake/ParseImplicitData/hand-CXX-relative.input index 0b223a1..568933a 100644 --- a/Tests/RunCMake/ParseImplicitData/hand-CXX-relative.input +++ b/Tests/RunCMake/ParseImplicitData/hand-CXX-relative.input @@ -16,8 +16,8 @@ This is a hand-written test case. #include "..." search starts here: #include <...> search starts here: /usr/local/include - ../../../adaptive/relative/include + ../../../../adaptive/relative/include /usr/include End of search list. -/usr/bin/ld -L/usr/lib64 -L../../../adaptive/relative/lib +/usr/bin/ld -L/usr/lib64 -L../../../../adaptive/relative/lib diff --git a/Tests/RunCMake/RunCTest.cmake b/Tests/RunCMake/RunCTest.cmake index 86f5b3a..d46f6ad 100644 --- a/Tests/RunCMake/RunCTest.cmake +++ b/Tests/RunCMake/RunCTest.cmake @@ -3,6 +3,7 @@ include(RunCMake) # Isolate our ctest runs from external environment. unset(ENV{CTEST_PARALLEL_LEVEL}) unset(ENV{CTEST_OUTPUT_ON_FAILURE}) +unset(ENV{CTEST_NO_TESTS_ACTION}) function(run_ctest CASE_NAME) configure_file(${RunCMake_SOURCE_DIR}/test.cmake.in diff --git a/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt b/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt index 34c873c..9f4f24e 100644 --- a/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt +++ b/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt @@ -1,3 +1,3 @@ --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) -- Build files have been written to: .*/Tests/RunCMake/configure_file/RerunCMake-build diff --git a/Tests/RunCMake/configure_file/RerunCMake-stdout.txt b/Tests/RunCMake/configure_file/RerunCMake-stdout.txt index 34c873c..9f4f24e 100644 --- a/Tests/RunCMake/configure_file/RerunCMake-stdout.txt +++ b/Tests/RunCMake/configure_file/RerunCMake-stdout.txt @@ -1,3 +1,3 @@ --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) -- Build files have been written to: .*/Tests/RunCMake/configure_file/RerunCMake-build diff --git a/Tests/RunCMake/message/ConfigureLog-config.txt b/Tests/RunCMake/message/ConfigureLog-config.txt new file mode 100644 index 0000000..49c12de --- /dev/null +++ b/Tests/RunCMake/message/ConfigureLog-config.txt @@ -0,0 +1,30 @@ +^ +--- +events: + - + kind: "message-v1" + backtrace: + - "ConfigureLog.cmake:[0-9]+ \(message\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + Message 0 + - + kind: "message-v1" + backtrace: + - "ConfigureLog.cmake:[0-9]+ \(message\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Check 1" + message: | + Message 1 + - + kind: "message-v1" + backtrace: + - "ConfigureLog.cmake:[0-9]+ \(message\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Check 2" + - "Check 1" + message: | + Message 2 +\.\.\.$ diff --git a/Tests/RunCMake/message/ConfigureLog-stdout.txt b/Tests/RunCMake/message/ConfigureLog-stdout.txt new file mode 100644 index 0000000..ba32642 --- /dev/null +++ b/Tests/RunCMake/message/ConfigureLog-stdout.txt @@ -0,0 +1,4 @@ +-- Check 1 +-- Check 2 +-- Check 2 - passed +-- Check 1 - passed diff --git a/Tests/RunCMake/message/ConfigureLog.cmake b/Tests/RunCMake/message/ConfigureLog.cmake new file mode 100644 index 0000000..6f2c1b0 --- /dev/null +++ b/Tests/RunCMake/message/ConfigureLog.cmake @@ -0,0 +1,7 @@ +message(CONFIGURE_LOG "Message 0") +message(CHECK_START "Check 1") +message(CONFIGURE_LOG "Message 1") +message(CHECK_START "Check 2") +message(CONFIGURE_LOG "Message 2") +message(CHECK_PASS "passed") +message(CHECK_PASS "passed") diff --git a/Tests/RunCMake/message/ConfigureLogScript-config.txt b/Tests/RunCMake/message/ConfigureLogScript-config.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/message/ConfigureLogScript-config.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/message/ConfigureLogScript-stdout.txt b/Tests/RunCMake/message/ConfigureLogScript-stdout.txt new file mode 100644 index 0000000..ba32642 --- /dev/null +++ b/Tests/RunCMake/message/ConfigureLogScript-stdout.txt @@ -0,0 +1,4 @@ +-- Check 1 +-- Check 2 +-- Check 2 - passed +-- Check 1 - passed diff --git a/Tests/RunCMake/message/ConfigureLogScript.cmake b/Tests/RunCMake/message/ConfigureLogScript.cmake new file mode 100644 index 0000000..e1cd21b --- /dev/null +++ b/Tests/RunCMake/message/ConfigureLogScript.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/ConfigureLog.cmake") diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake index 1233838..c54e8f2 100644 --- a/Tests/RunCMake/message/RunCMakeTest.cmake +++ b/Tests/RunCMake/message/RunCMakeTest.cmake @@ -1,7 +1,9 @@ include(RunCMake) +run_cmake_script(ConfigureLogScript) run_cmake_script(newline) +run_cmake(ConfigureLog) run_cmake(defaultmessage) run_cmake(nomessage) run_cmake(message-internal-warning) diff --git a/Tests/RunCMake/try_compile/CMP0128-common.cmake b/Tests/RunCMake/try_compile/CMP0128-common.cmake index 0b8a12b..64b1a77 100644 --- a/Tests/RunCMake/try_compile/CMP0128-common.cmake +++ b/Tests/RunCMake/try_compile/CMP0128-common.cmake @@ -1,10 +1,6 @@ cmake_policy(SET CMP0067 NEW) enable_language(CXX) -# Isolate the one try_compile below in the error log. -set(CMakeError_log "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log") -file(REMOVE "${CMakeError_log}") - # Add our own -std= flag to the try_compile check. set(CMAKE_REQUIRED_FLAGS -std=c++11) @@ -24,8 +20,21 @@ int main() } " SRC_COMPILED) if(NOT SRC_COMPILED) - if(EXISTS "${CMakeError_log}") - file(READ "${CMakeError_log}" err_log) + message("Check failed to compile:") + set(configure_log "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeConfigureLog.yaml") + if(EXISTS "${configure_log}") + file(READ "${configure_log}" log_content) + else() + set(log_content "") + endif() + if(log_content MATCHES [[( - + kind: "try_compile-v1"( ++ [^ +]+)+ + checks: + - "Performing Test SRC_COMPILED"( ++ [^ +]+)+)]]) + message("${configure_log} contains:\n${CMAKE_MATCH_1}") endif() - message("${err_log}") endif() diff --git a/Tests/RunCMake/try_compile/ConfigureLog-bad.c b/Tests/RunCMake/try_compile/ConfigureLog-bad.c new file mode 100644 index 0000000..6508ead --- /dev/null +++ b/Tests/RunCMake/try_compile/ConfigureLog-bad.c @@ -0,0 +1 @@ +#error "This does not compile!" diff --git a/Tests/RunCMake/try_compile/ConfigureLog-config.txt b/Tests/RunCMake/try_compile/ConfigureLog-config.txt new file mode 100644 index 0000000..1f848bf --- /dev/null +++ b/Tests/RunCMake/try_compile/ConfigureLog-config.txt @@ -0,0 +1,66 @@ +^ +--- +events:( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)+ + - + kind: "try_compile-v1" + backtrace: + - "[^"]*/Modules/CMakeDetermineCompilerABI.cmake:[0-9]+ \(try_compile\)" + - "[^"]*/Modules/CMakeTestCCompiler.cmake:[0-9]+ \(CMAKE_DETERMINE_COMPILER_ABI\)" + - "ConfigureLog.cmake:[0-9]+ \(enable_language\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Detecting C compiler ABI info" + directories: + source: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" + binary: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" + buildResult: + variable: "CMAKE_C_ABI_COMPILED" + cached: true + stdout: \|.* + exitCode: 0( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)* + - + kind: "try_compile-v1" + backtrace: + - "ConfigureLog.cmake:[0-9]+ \(try_compile\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + description: "Source that should not compile\." + directories: + source: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" + binary: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" + buildResult: + variable: "COMPILE_RESULT" + cached: true + stdout: \|.* + exitCode: [1-9][0-9]* + - + kind: "try_compile-v1" + backtrace: + - "ConfigureLog.cmake:[0-9]+ \(try_compile\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Check 2" + - "Check 1" + description: "Source that should compile\." + directories: + source: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" + binary: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" + buildResult: + variable: "COMPILE_RESULT" + cached: true + stdout: \|.* + exitCode: 0 +\.\.\.$ diff --git a/Tests/RunCMake/try_compile/ConfigureLog-stdout.txt b/Tests/RunCMake/try_compile/ConfigureLog-stdout.txt new file mode 100644 index 0000000..ba32642 --- /dev/null +++ b/Tests/RunCMake/try_compile/ConfigureLog-stdout.txt @@ -0,0 +1,4 @@ +-- Check 1 +-- Check 2 +-- Check 2 - passed +-- Check 1 - passed diff --git a/Tests/RunCMake/try_compile/ConfigureLog-test.c b/Tests/RunCMake/try_compile/ConfigureLog-test.c new file mode 100644 index 0000000..8488f4e --- /dev/null +++ b/Tests/RunCMake/try_compile/ConfigureLog-test.c @@ -0,0 +1,4 @@ +int main(void) +{ + return 0; +} diff --git a/Tests/RunCMake/try_compile/ConfigureLog.cmake b/Tests/RunCMake/try_compile/ConfigureLog.cmake new file mode 100644 index 0000000..294e0f9 --- /dev/null +++ b/Tests/RunCMake/try_compile/ConfigureLog.cmake @@ -0,0 +1,25 @@ +enable_language(C) + +try_compile(COMPILE_RESULT + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-bad.c + LOG_DESCRIPTION "Source that should not compile." + ) + +try_compile(COMPILE_RESULT + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c + NO_LOG + ) + +message(CHECK_START "Check 1") +message(CHECK_START "Check 2") +try_compile(COMPILE_RESULT + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c + LOG_DESCRIPTION "Source that should compile." + ) +if (COMPILE_RESULT) + message(CHECK_PASS "passed") + message(CHECK_PASS "passed") +else() + message(CHECK_FAIL "failed") + message(CHECK_FAIL "failed") +endif() diff --git a/Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt b/Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt index b1344bd..b03e0b3 100644 --- a/Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt +++ b/Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt @@ -7,3 +7,11 @@ CMake Error at EmptyValueArgs.cmake:[0-9]+ \(try_compile\): COPY_FILE_ERROR must be followed by a variable name Call Stack \(most recent call first\): CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at EmptyValueArgs.cmake:[0-9]+ \(try_compile\): + Error after keyword "LOG_DESCRIPTION": + + empty string not allowed + +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/try_compile/EmptyValueArgs.cmake b/Tests/RunCMake/try_compile/EmptyValueArgs.cmake index fda4f10..f0052c5 100644 --- a/Tests/RunCMake/try_compile/EmptyValueArgs.cmake +++ b/Tests/RunCMake/try_compile/EmptyValueArgs.cmake @@ -5,3 +5,6 @@ try_compile(RESULT ${try_compile_bindir_or_SOURCES} try_compile(RESULT ${try_compile_bindir_or_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/src.c COPY_FILE "x" COPY_FILE_ERROR "") +try_compile(RESULT ${try_compile_bindir_or_SOURCES} + ${CMAKE_CURRENT_SOURCE_DIR}/src.c + LOG_DESCRIPTION "") diff --git a/Tests/RunCMake/try_compile/Inspect-config.txt b/Tests/RunCMake/try_compile/Inspect-config.txt index 47169cf..7a39335 100644 --- a/Tests/RunCMake/try_compile/Inspect-config.txt +++ b/Tests/RunCMake/try_compile/Inspect-config.txt @@ -1,6 +1,13 @@ ^ --- -events: +events:( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)+ - kind: "try_compile-v1" backtrace: @@ -8,6 +15,8 @@ events: - "[^"]*/Modules/CMakeTestCCompiler.cmake:[0-9]+ \(CMAKE_DETERMINE_COMPILER_ABI\)" - "Inspect.cmake:[0-9]+ \(enable_language\)" - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Detecting C compiler ABI info" directories: source: "[^"]*/Tests/RunCMake/try_compile/Inspect-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" binary: "[^"]*/Tests/RunCMake/try_compile/Inspect-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" @@ -15,7 +24,14 @@ events: variable: "CMAKE_C_ABI_COMPILED" cached: true stdout: \|.* - exitCode: 0 + exitCode: 0( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)+ - kind: "try_compile-v1" backtrace: @@ -23,6 +39,8 @@ events: - "[^"]*/Modules/CMakeTestCXXCompiler.cmake:[0-9]+ \(CMAKE_DETERMINE_COMPILER_ABI\)" - "Inspect.cmake:[0-9]+ \(enable_language\)" - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Detecting CXX compiler ABI info" directories: source: "[^"]*/Tests/RunCMake/try_compile/Inspect-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" binary: "[^"]*/Tests/RunCMake/try_compile/Inspect-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" @@ -30,5 +48,12 @@ events: variable: "CMAKE_CXX_ABI_COMPILED" cached: true stdout: \|.* - exitCode: 0 + exitCode: 0( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)* \.\.\.$ diff --git a/Tests/RunCMake/try_compile/NoLogDescription-result.txt b/Tests/RunCMake/try_compile/NoLogDescription-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_compile/NoLogDescription-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NoLogDescription-stderr.txt b/Tests/RunCMake/try_compile/NoLogDescription-stderr.txt new file mode 100644 index 0000000..9005bcd --- /dev/null +++ b/Tests/RunCMake/try_compile/NoLogDescription-stderr.txt @@ -0,0 +1,7 @@ +CMake Error at NoLogDescription.cmake:[0-9]+ \(try_compile\): + Error after keyword "LOG_DESCRIPTION": + + missing required value + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoLogDescription.cmake b/Tests/RunCMake/try_compile/NoLogDescription.cmake new file mode 100644 index 0000000..904763f --- /dev/null +++ b/Tests/RunCMake/try_compile/NoLogDescription.cmake @@ -0,0 +1,4 @@ +include(${CMAKE_CURRENT_SOURCE_DIR}/${try_compile_DEFS}) +try_compile(RESULT ${try_compile_bindir_or_SOURCES} + ${CMAKE_CURRENT_SOURCE_DIR}/src.c + LOG_DESCRIPTION) diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt index b0438f5..a5ca781 100644 --- a/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt +++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt @@ -1,5 +1,5 @@ Running CMake on RerunCMake FALSE --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) -- Build files have been written to: .*/Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt index 9c78b26..e37d210 100644 --- a/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt +++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt @@ -1,3 +1,3 @@ --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) -- Build files have been written to: .*/Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RerunCMake-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-stdout.txt index 9c78b26..e37d210 100644 --- a/Tests/RunCMake/try_compile/RerunCMake-stdout.txt +++ b/Tests/RunCMake/try_compile/RerunCMake-stdout.txt @@ -1,3 +1,3 @@ --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) -- Build files have been written to: .*/Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index ad1cc29..51ccac8 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -15,6 +15,7 @@ run_cmake_with_options(Inspect ) include("${RunCMake_BINARY_DIR}/Inspect-build/info.cmake") +run_cmake(ConfigureLog) run_cmake(NoArgs) run_cmake(OneArg) run_cmake(TwoArgs) diff --git a/Tests/RunCMake/try_compile/SourceFromBadName-config.txt b/Tests/RunCMake/try_compile/SourceFromBadName-config.txt index 10f3293..cb76565 100644 --- a/Tests/RunCMake/try_compile/SourceFromBadName-config.txt +++ b/Tests/RunCMake/try_compile/SourceFromBadName-config.txt @@ -1 +1,11 @@ -^$ +^ +--- +events:( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)+ +\.\.\.$ diff --git a/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake b/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake index 3158e32..0e4cc20 100644 --- a/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake +++ b/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake @@ -12,6 +12,7 @@ run_cmake(NoCopyFile) run_cmake(NoCopyFile2) run_cmake(NoCopyFileError) run_cmake(NoCStandard) +run_cmake(NoLogDescription) run_cmake(NoOutputVariable) run_cmake(NoOutputVariable2) run_cmake(BadLinkLibraries) diff --git a/Tests/RunCMake/try_run/ConfigureLog-config.txt b/Tests/RunCMake/try_run/ConfigureLog-config.txt index 602437e..bf3c3bd 100644 --- a/Tests/RunCMake/try_run/ConfigureLog-config.txt +++ b/Tests/RunCMake/try_run/ConfigureLog-config.txt @@ -1,12 +1,21 @@ ^ --- -events: +events:( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)+ - kind: "try_compile-v1" backtrace: - "[^"]*/Modules/CMakeDetermineCompilerABI.cmake:[0-9]+ \(try_compile\)" - "[^"]*/Modules/CMakeTestCCompiler.cmake:[0-9]+ \(CMAKE_DETERMINE_COMPILER_ABI\)" - "CMakeLists.txt:[0-9]+ \(project\)" + checks: + - "Detecting C compiler ABI info" directories: source: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" binary: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" @@ -14,12 +23,20 @@ events: variable: "CMAKE_C_ABI_COMPILED" cached: true stdout: \|.* - exitCode: 0 + exitCode: 0( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)* - kind: "try_run-v1" backtrace: - "ConfigureLog.cmake:[0-9]+ \(try_run\)" - "CMakeLists.txt:[0-9]+ \(include\)" + description: "Source that should not compile\." directories: source: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" binary: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" @@ -36,6 +53,9 @@ events: backtrace: - "ConfigureLog.cmake:[0-9]+ \(try_run\)" - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Check 1" + description: "Source that should compile\." directories: source: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" binary: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" @@ -57,6 +77,9 @@ events: backtrace: - "ConfigureLog.cmake:[0-9]+ \(try_run\)" - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Check 2" + - "Check 1" directories: source: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" binary: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" diff --git a/Tests/RunCMake/try_run/ConfigureLog-stdout.txt b/Tests/RunCMake/try_run/ConfigureLog-stdout.txt new file mode 100644 index 0000000..ba32642 --- /dev/null +++ b/Tests/RunCMake/try_run/ConfigureLog-stdout.txt @@ -0,0 +1,4 @@ +-- Check 1 +-- Check 2 +-- Check 2 - passed +-- Check 1 - passed diff --git a/Tests/RunCMake/try_run/ConfigureLog.cmake b/Tests/RunCMake/try_run/ConfigureLog.cmake index 4b5c7cb..6635d73 100644 --- a/Tests/RunCMake/try_run/ConfigureLog.cmake +++ b/Tests/RunCMake/try_run/ConfigureLog.cmake @@ -1,15 +1,31 @@ try_run(RUN_RESULT COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-bad.c + LOG_DESCRIPTION "Source that should not compile." ) try_run(RUN_RESULT COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c + NO_LOG ) +message(CHECK_START "Check 1") +try_run(RUN_RESULT COMPILE_RESULT + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c + LOG_DESCRIPTION "Source that should compile." + ) + +message(CHECK_START "Check 2") try_run(RUN_RESULT COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c RUN_OUTPUT_VARIABLE RUN_OUTPUT ) +if (RUN_RESULT) + message(CHECK_PASS "passed") + message(CHECK_PASS "passed") +else() + message(CHECK_FAIL "failed") + message(CHECK_FAIL "failed") +endif() try_run(RUN_RESULT COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c diff --git a/Tests/RunCMake/try_run/CrossCompile.cmake b/Tests/RunCMake/try_run/CrossCompile.cmake new file mode 100644 index 0000000..4993768 --- /dev/null +++ b/Tests/RunCMake/try_run/CrossCompile.cmake @@ -0,0 +1,8 @@ +include(${CMAKE_CURRENT_SOURCE_DIR}/${try_compile_DEFS}) + +# Pretend we are cross-compiling to take that try_run code path. +set(CMAKE_CROSSCOMPILING 1) +set(RUN_RESULT 0) +try_run(RUN_RESULT COMPILE_RESULT ${try_compile_bindir_or_SOURCES} + ${CMAKE_CURRENT_SOURCE_DIR}/src.c) +unset(CMAKE_CROSSCOMPILING) diff --git a/Tests/RunCMake/try_run/old_and_new_signature_tests.cmake b/Tests/RunCMake/try_run/old_and_new_signature_tests.cmake index e1c1784..2b51eb2 100644 --- a/Tests/RunCMake/try_run/old_and_new_signature_tests.cmake +++ b/Tests/RunCMake/try_run/old_and_new_signature_tests.cmake @@ -11,6 +11,8 @@ run_cmake(BadLinkLibraries) run_cmake(BinDirEmpty) run_cmake(BinDirRelative) +run_cmake(CrossCompile) + run_cmake(WorkingDirArg) run_cmake(NoCompileOutputVariable) diff --git a/Tests/StringFileTest/StringFile.cxx b/Tests/StringFileTest/StringFile.cxx index c890e8e..073e30c 100644 --- a/Tests/StringFileTest/StringFile.cxx +++ b/Tests/StringFileTest/StringFile.cxx @@ -3,7 +3,7 @@ #include "OutputFile.h" -int main(int, char* []) +int main(int, char*[]) { int res = 0; diff --git a/Tests/SystemInformation/CMakeLists.txt b/Tests/SystemInformation/CMakeLists.txt index db54612..9a2c4eb 100644 --- a/Tests/SystemInformation/CMakeLists.txt +++ b/Tests/SystemInformation/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 3.0) project(SystemInformation) -include_directories("This does not exists") +include_directories("This does not exist") get_directory_property(incl INCLUDE_DIRECTORIES) set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${SystemInformation_BINARY_DIR};${SystemInformation_SOURCE_DIR}") diff --git a/Tests/SystemInformation/DumpInformation.cxx b/Tests/SystemInformation/DumpInformation.cxx index 4328675..913e4c4 100644 --- a/Tests/SystemInformation/DumpInformation.cxx +++ b/Tests/SystemInformation/DumpInformation.cxx @@ -53,7 +53,7 @@ void cmDumpInformationPrintFile(const char* name, FILE* fout) } } -int main(int, char* []) +int main(int, char*[]) { const char* files[] = { DumpInformation_BINARY_DIR "/SystemInformation.out", @@ -63,13 +63,9 @@ int main(int, char* []) DumpInformation_BINARY_DIR "/OtherProperties.txt", DumpInformation_BINARY_DIR "/../../Source/cmConfigure.h", DumpInformation_BINARY_DIR "/../../CMakeCache.txt", - DumpInformation_BINARY_DIR "/../../CMakeFiles/CMakeOutput.log", - DumpInformation_BINARY_DIR "/../../CMakeFiles/CMakeError.log", DumpInformation_BINARY_DIR "/../../Bootstrap.cmk/cmake_bootstrap.log", DumpInformation_BINARY_DIR "/../../Source/cmsys/Configure.hxx", DumpInformation_BINARY_DIR "/../../Source/cmsys/Configure.h", - DumpInformation_BINARY_DIR "/CMakeFiles/CMakeOutput.log", - DumpInformation_BINARY_DIR "/CMakeFiles/CMakeError.log", 0 }; diff --git a/Tests/VSMASM/CMakeLists.txt b/Tests/VSMASM/CMakeLists.txt index 603a43b..49bd24a 100644 --- a/Tests/VSMASM/CMakeLists.txt +++ b/Tests/VSMASM/CMakeLists.txt @@ -8,3 +8,5 @@ else() endif() include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) add_executable(VSMASM main.c foo.asm) +target_compile_definitions(VSMASM PUBLIC DEF_FOO) +target_compile_options(VSMASM PUBLIC -DDEF_BAR) diff --git a/Tests/VSMASM/foo.asm b/Tests/VSMASM/foo.asm index 51cb969..97bdd1a 100644 --- a/Tests/VSMASM/foo.asm +++ b/Tests/VSMASM/foo.asm @@ -1,3 +1,9 @@ +ifndef DEF_FOO +.err <DEF_FOO incorrectly not defined> +endif +ifndef DEF_BAR +.err <DEF_BAR incorrectly not defined> +endif ifndef TESTx64 .386 .model flat, c diff --git a/Tests/VSWinStorePhone/Direct3DApp1/.gitattributes b/Tests/VSWinStorePhone/Direct3DApp1/.gitattributes index 78a5469..601c97b 100644 --- a/Tests/VSWinStorePhone/Direct3DApp1/.gitattributes +++ b/Tests/VSWinStorePhone/Direct3DApp1/.gitattributes @@ -1 +1 @@ -Direct3DApp1.cpp -format.clang-format-6.0 +Direct3DApp1.cpp -format.clang-format diff --git a/Tests/VSWinStorePhone/Direct3DApp1/BasicTimer.h b/Tests/VSWinStorePhone/Direct3DApp1/BasicTimer.h index 56bd398..ccbbcda 100644 --- a/Tests/VSWinStorePhone/Direct3DApp1/BasicTimer.h +++ b/Tests/VSWinStorePhone/Direct3DApp1/BasicTimer.h @@ -52,13 +52,19 @@ public: // Update(). property float Total { - float get() { return m_total; } + float get() + { + return m_total; + } } // Duration in seconds between the previous two calls to Update(). property float Delta { - float get() { return m_delta; } + float get() + { + return m_delta; + } } private: diff --git a/Tests/Wrapping/Wrap.c b/Tests/Wrapping/Wrap.c index e8fb8a5..30ac173 100644 --- a/Tests/Wrapping/Wrap.c +++ b/Tests/Wrapping/Wrap.c @@ -1,7 +1,8 @@ #include <stdio.h> #ifdef __CLASSIC_C__ -int main(argc, argv) int argc; +int main(argc, argv) +int argc; char** argv; #else int main(int argc, const char* argv[]) |