From e87ed7e5b18f22b240f729199a8e651bc98428e2 Mon Sep 17 00:00:00 2001 From: Skywol Date: Tue, 20 Sep 2022 13:03:40 +0800 Subject: [PATCH 01/15] Add the "make uninstall" target (#1130) --- CMakeLists.txt | 11 +++++++++++ cmake_uninstall.cmake.in | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 cmake_uninstall.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index afd5409..c9b1867 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,3 +194,14 @@ if (YAML_CPP_FORMAT_SOURCE AND YAML_CPP_CLANG_FORMAT_EXE) COMMENT "Running clang-format" VERBATIM) endif() + +# uninstall target +if(NOT TARGET uninstall) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) + + add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) +endif() diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in new file mode 100644 index 0000000..c2d34d4 --- /dev/null +++ b/cmake_uninstall.cmake.in @@ -0,0 +1,21 @@ +if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") +endif() + +file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) +string(REGEX REPLACE "\n" ";" files "${files}") +foreach(file ${files}) + message(STATUS "Uninstalling $ENV{DESTDIR}${file}") + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + exec_program( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + endif() + else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + endif() +endforeach() From 763b7d6c7072ea785b90056b423f7d727731e59c Mon Sep 17 00:00:00 2001 From: rdzehtsiar <105226800+rdzehtsiar@users.noreply.github.com> Date: Tue, 20 Sep 2022 07:04:18 +0200 Subject: [PATCH 02/15] Fix compilation errors in build for Oracle Solaris OS (#1133) On Oracle Solaris the following statement is declared in file /usr/include/sys/regset.h: #define SS 18 /* only stored on a privilege transition */ Because of this template type name SS is substituted by numeric literal, which results in a compilation error: error: expected nested-name-specifier before numeric constant Fixed by renaming template type names. Co-authored-by: Roman Degtyar --- include/yaml-cpp/traits.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/yaml-cpp/traits.h b/include/yaml-cpp/traits.h index 9a62db2..ffe9999 100644 --- a/include/yaml-cpp/traits.h +++ b/include/yaml-cpp/traits.h @@ -107,9 +107,9 @@ struct disable_if : public disable_if_c {}; template struct is_streamable { - template + template static auto test(int) - -> decltype(std::declval() << std::declval(), std::true_type()); + -> decltype(std::declval() << std::declval(), std::true_type()); template static auto test(...) -> std::false_type; From 255bf1f9bccfb8cac5fc9ea70fe528423f2e58b9 Mon Sep 17 00:00:00 2001 From: Timo Gurr Date: Tue, 20 Sep 2022 07:17:13 +0200 Subject: [PATCH 03/15] Install pkgconfig and cmake files into arch-dependent locations (#1055) --- CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9b1867..638ced9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,9 +142,7 @@ set_target_properties(yaml-cpp PROPERTIES PROJECT_LABEL "yaml-cpp ${yaml-cpp-label-postfix}" DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}") -# FIXME(felix2012): A more common place for the cmake export would be -# `CMAKE_INSTALL_LIBDIR`, as e.g. done in ubuntu or in this project for GTest -set(CONFIG_EXPORT_DIR "${CMAKE_INSTALL_DATADIR}/cmake/yaml-cpp") +set(CONFIG_EXPORT_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/yaml-cpp") set(EXPORT_TARGETS yaml-cpp) configure_package_config_file( "${PROJECT_SOURCE_DIR}/yaml-cpp-config.cmake.in" @@ -175,7 +173,7 @@ if (YAML_CPP_INSTALL) "${PROJECT_BINARY_DIR}/yaml-cpp-config-version.cmake" DESTINATION "${CONFIG_EXPORT_DIR}") install(FILES "${PROJECT_BINARY_DIR}/yaml-cpp.pc" - DESTINATION ${CMAKE_INSTALL_DATADIR}/pkgconfig) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif() unset(CONFIG_EXPORT_DIR) From c86a9e424c5ee48e04e0412e9edf44f758e38fb9 Mon Sep 17 00:00:00 2001 From: Baruch Date: Tue, 20 Sep 2022 08:22:11 +0300 Subject: [PATCH 04/15] Minimize warnings when not the top-level project (#1124) Minimize warnings when not the top-level project Should fix #970 and #764 when trying to add yaml-cpp to other project --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 638ced9..f2c3c62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,11 +106,15 @@ if (NOT DEFINED CMAKE_CXX_STANDARD) CXX_STANDARD 11) endif() +if(YAML_CPP_MAIN_PROJECT) + target_compile_options(yaml-cpp + PRIVATE + $<${not-msvc}:-Wall -Wextra -Wshadow -Weffc++ -Wno-long-long> + $<${not-msvc}:-pedantic -pedantic-errors>) +endif() + target_compile_options(yaml-cpp PRIVATE - $<${not-msvc}:-Wall -Wextra -Wshadow -Weffc++ -Wno-long-long> - $<${not-msvc}:-pedantic -pedantic-errors> - $<$:-MTd> $<$:-MT> $<$:-MDd> From 85ad599d7949c7865d01ea20c768877dab8b113f Mon Sep 17 00:00:00 2001 From: stephematician Date: Tue, 20 Sep 2022 15:24:35 +1000 Subject: [PATCH 05/15] Basic update to CMakeLists.txt to address #1116 (#1117) Add definitions to static yaml-cpp target (fixes #1116) Also updates CONTRIBUTING instructions for tests --- CMakeLists.txt | 3 ++- CONTRIBUTING.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f2c3c62..ad4ea99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,6 @@ if (YAML_BUILD_SHARED_LIBS) else() set(yaml-cpp-type STATIC) set(yaml-cpp-label-postfix "static") - add_definitions(-DYAML_CPP_STATIC_DEFINE) endif() set(build-shared $) @@ -127,6 +126,8 @@ target_compile_options(yaml-cpp $<$:/W3 /wd4127 /wd4355>) target_compile_definitions(yaml-cpp + PUBLIC + $<$>:YAML_CPP_STATIC_DEFINE> PRIVATE $<${build-windows-dll}:${PROJECT_NAME}_DLL> $<$>:YAML_CPP_NO_CONTRIB>) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cd09a1a..5705fe2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,7 +17,7 @@ Commit messages should be in the imperative mood, as described in the [Git contr # Tests -Please verify the tests pass by running the target `tests/run_tests`. +Please verify the tests pass by running the target `test/yaml-cpp-tests`. If you are adding functionality, add tests accordingly. From 97ebcf035ab7a3fb6ceed99e68f02759cff6ef86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Derzsi=20D=C3=A1niel?= Date: Tue, 20 Sep 2022 08:26:59 +0300 Subject: [PATCH 06/15] Export library directory and shared libs to CMake config (#1113) This pull request adds two new exported variables to the CMake config: YAML_CPP_LIBRARY_DIR - points to the directory containing the built library files YAML_CPP_SHARED_LIBS_BUILT - boolean value, lets users know whether shared libraries were built or not --- CMakeLists.txt | 2 +- yaml-cpp-config.cmake.in | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ad4ea99..42e3bf7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,7 +153,7 @@ configure_package_config_file( "${PROJECT_SOURCE_DIR}/yaml-cpp-config.cmake.in" "${PROJECT_BINARY_DIR}/yaml-cpp-config.cmake" INSTALL_DESTINATION "${CONFIG_EXPORT_DIR}" - PATH_VARS CMAKE_INSTALL_INCLUDEDIR CONFIG_EXPORT_DIR) + PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR CONFIG_EXPORT_DIR YAML_BUILD_SHARED_LIBS) unset(EXPORT_TARGETS) write_basic_package_version_file( diff --git a/yaml-cpp-config.cmake.in b/yaml-cpp-config.cmake.in index a7ace3d..799b9b4 100644 --- a/yaml-cpp-config.cmake.in +++ b/yaml-cpp-config.cmake.in @@ -1,11 +1,17 @@ # - Config file for the yaml-cpp package # It defines the following variables -# YAML_CPP_INCLUDE_DIR - include directory -# YAML_CPP_LIBRARIES - libraries to link against +# YAML_CPP_INCLUDE_DIR - include directory +# YAML_CPP_LIBRARY_DIR - directory containing libraries +# YAML_CPP_SHARED_LIBS_BUILT - whether we have built shared libraries or not +# YAML_CPP_LIBRARIES - libraries to link against @PACKAGE_INIT@ set_and_check(YAML_CPP_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") +set_and_check(YAML_CPP_LIBRARY_DIR "@PACKAGE_CMAKE_INSTALL_LIBDIR@") + +# Are we building shared libraries? +set(YAML_CPP_SHARED_LIBS_BUILT "@PACKAGE_YAML_BUILD_SHARED_LIBS@") # Our library dependencies (contains definitions for IMPORTED targets) include(@PACKAGE_CONFIG_EXPORT_DIR@/yaml-cpp-targets.cmake) From 4ae4cb7309c07b2d8623d7e4f01efa6321441366 Mon Sep 17 00:00:00 2001 From: sfalmo <52037539+sfalmo@users.noreply.github.com> Date: Tue, 20 Sep 2022 07:31:51 +0200 Subject: [PATCH 07/15] Support conversion for std::valarray (#956) --- include/yaml-cpp/node/convert.h | 32 ++++++++++++++++++++++++++++++++ test/node/node_test.cpp | 10 ++++++++++ 2 files changed, 42 insertions(+) diff --git a/include/yaml-cpp/node/convert.h b/include/yaml-cpp/node/convert.h index 8ab0cd4..292c5d3 100644 --- a/include/yaml-cpp/node/convert.h +++ b/include/yaml-cpp/node/convert.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include "yaml-cpp/binary.h" @@ -363,6 +364,37 @@ struct convert> { } }; + +// std::valarray +template +struct convert> { + static Node encode(const std::valarray& rhs) { + Node node(NodeType::Sequence); + for (const auto& element : rhs) { + node.push_back(element); + } + return node; + } + + static bool decode(const Node& node, std::valarray& rhs) { + if (!node.IsSequence()) { + return false; + } + + rhs.resize(node.size()); + for (auto i = 0u; i < node.size(); ++i) { +#if defined(__GNUC__) && __GNUC__ < 4 + // workaround for GCC 3: + rhs[i] = node[i].template as(); +#else + rhs[i] = node[i].as(); +#endif + } + return true; + } +}; + + // std::pair template struct convert> { diff --git a/test/node/node_test.cpp b/test/node/node_test.cpp index d4367c5..b501005 100644 --- a/test/node/node_test.cpp +++ b/test/node/node_test.cpp @@ -352,6 +352,16 @@ TEST(NodeTest, StdArrayWrongSize) { (node["evens"].as>()), ErrorMsg::BAD_CONVERSION); } +TEST(NodeTest, StdValrray) { + std::valarray evens{{2, 4, 6, 8, 10}}; + Node node; + node["evens"] = evens; + std::valarray actualEvens = node["evens"].as>(); + for (int i = 0; i < evens.size(); ++i) { + EXPECT_EQ(evens[i], actualEvens[i]); + } +} + TEST(NodeTest, StdVector) { std::vector primes; primes.push_back(2); From 1b50109f7bea60bd382d8ea7befce3d2bd67da5f Mon Sep 17 00:00:00 2001 From: James Brown Date: Wed, 5 Oct 2022 12:51:53 +1300 Subject: [PATCH 08/15] Include property nodes in the long key check (#1140) --- src/emitter.cpp | 3 ++- test/integration/emitter_test.cpp | 34 ++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/emitter.cpp b/src/emitter.cpp index 644b312..4d48307 100644 --- a/src/emitter.cpp +++ b/src/emitter.cpp @@ -533,7 +533,8 @@ void Emitter::BlockMapPrepareNode(EmitterNodeType::value child) { if (m_pState->GetMapKeyFormat() == LongKey) m_pState->SetLongKey(); if (child == EmitterNodeType::BlockSeq || - child == EmitterNodeType::BlockMap) + child == EmitterNodeType::BlockMap || + child == EmitterNodeType::Property) m_pState->SetLongKey(); if (m_pState->CurGroupLongKey()) diff --git a/test/integration/emitter_test.cpp b/test/integration/emitter_test.cpp index 53407c9..b277d57 100644 --- a/test/integration/emitter_test.cpp +++ b/test/integration/emitter_test.cpp @@ -431,6 +431,38 @@ TEST_F(EmitterTest, BlockMapAsKey) { ExpectEmit("? key: value\n next key: next value\n: total value"); } +TEST_F(EmitterTest, TaggedBlockMapAsKey) { + out << BeginMap; + out << Key; + out << LocalTag("innerMap"); + out << BeginMap; + out << Key << "key" << Value << "value"; + out << EndMap; + out << Value; + out << "outerValue"; + out << EndMap; + + ExpectEmit(R"(? !innerMap + key: value +: outerValue)"); +} + +TEST_F(EmitterTest, TaggedBlockListAsKey) { + out << BeginMap; + out << Key; + out << LocalTag("innerList"); + out << BeginSeq; + out << "listItem"; + out << EndSeq; + out << Value; + out << "outerValue"; + out << EndMap; + + ExpectEmit(R"(? !innerList + - listItem +: outerValue)"); +} + TEST_F(EmitterTest, AliasAndAnchor) { out << BeginSeq; out << Anchor("fred"); @@ -520,7 +552,7 @@ TEST_F(EmitterTest, VerbatimTagInBlockMap) { out << Value << VerbatimTag("!waz") << "baz"; out << EndMap; - ExpectEmit("! bar: ! baz"); + ExpectEmit("? ! bar\n: ! baz"); } TEST_F(EmitterTest, VerbatimTagInFlowMap) { From bdc5582b3520f4021c03af73915cbe53d834e6a4 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Thu, 2 Mar 2023 02:27:51 +0100 Subject: [PATCH 09/15] Add tests for iterator and const_iterator on sequence (#1169) --- test/node/node_test.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/node/node_test.cpp b/test/node/node_test.cpp index b501005..ff3d799 100644 --- a/test/node/node_test.cpp +++ b/test/node/node_test.cpp @@ -323,6 +323,38 @@ TEST(NodeTest, IteratorOnConstUndefinedNode) { } EXPECT_EQ(0, count); } + +TEST(NodeTest, InteratorOnSequence) { + Node node; + node[0] = "a"; + node[1] = "b"; + node[2] = "c"; + EXPECT_TRUE(node.IsSequence()); + + std::size_t count = 0; + for (iterator it = node.begin(); it != node.end(); ++it) + { + EXPECT_FALSE(it->IsNull()); + count++; + } + EXPECT_EQ(3, count); +} + +TEST(NodeTest, ConstInteratorOnSequence) { + Node node; + node[0] = "a"; + node[1] = "b"; + node[2] = "c"; + EXPECT_TRUE(node.IsSequence()); + + std::size_t count = 0; + for (const_iterator it = node.begin(); it != node.end(); ++it) + { + EXPECT_FALSE(it->IsNull()); + count++; + } + EXPECT_EQ(3, count); +} TEST(NodeTest, SimpleSubkeys) { Node node; From d7f672d1413040d2ea850ecb32644150da2e10db Mon Sep 17 00:00:00 2001 From: Diogo Teles Sant'Anna Date: Sat, 4 Mar 2023 02:33:51 -0300 Subject: [PATCH 10/15] CI: define read-only permission for GitHub Workflow (#1175) It secures the repo against erroneous or malicious actions from external jobs you call from your workflow. It's specially important for the case they get compromised, for example. --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 581c559..cf06817 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,7 @@ on: pull_request: branches: [ master ] workflow_dispatch: +permissions: read-all jobs: cmake-build: strategy: From 3ff7ab07ac83e36e1e0f56aa789a69e511ad78d0 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Sat, 4 Mar 2023 21:06:01 +0100 Subject: [PATCH 11/15] Make sure tests are run in CI (#1170) * Test(CMake) set NAME and COMMAND in add_test * (CMake) add enable_testing() * (CMake) move cmake_dependent_option up, before using them * (CMake) use YAML_CPP_MAIN_PROJECT in cmake_dependent_option * (CMake) log values regarding tests * (CMake) always find CTest, but don't enable tests * (CMAKE)(temp) fix logging * (actions) set YAML_CPP_BUILD_TESTS for tests * (actions) provide YAML_CPP_BUILD_TESTS to ctest * (actions) set -DYAML_CPP_BUILD_TESTS at build * (actions) don't fail false * (actions) build tests in Test step * (actions) run tests verbose * (CMake) remove temp logging * (actions) split building from running tests * (actions) ctest Debug * (actions) ctest Debug * Remove enable_testing --- .github/workflows/build.yml | 15 ++++++++++++--- CMakeLists.txt | 18 +++++++----------- test/CMakeLists.txt | 2 +- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf06817..a408a9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,7 @@ permissions: read-all jobs: cmake-build: strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] build: [static, shared] @@ -22,6 +23,7 @@ jobs: generator: "MinGW Makefiles" env: YAML_BUILD_SHARED_LIBS: ${{ matrix.build == 'shared' && 'ON' || 'OFF' }} + YAML_CPP_BUILD_TESTS: 'ON' CMAKE_GENERATOR: >- ${{format(matrix.generator != 'Default Generator' && '-G "{0}"' || '', matrix.generator)}} runs-on: ${{ matrix.os }} @@ -36,10 +38,17 @@ jobs: run: | cmake ${{ env.CMAKE_GENERATOR }} -S "${{ github.workspace }}" -B build -DYAML_BUILD_SHARED_LIBS=${{ env.YAML_BUILD_SHARED_LIBS }} cd build && cmake --build . --parallel ${{ steps.cpu-cores.outputs.count }} - - - name: Test + + - name: Build Tests shell: bash - run: cd build && ctest --output-on-failure + run: | + cmake ${{ env.CMAKE_GENERATOR }} -S "${{ github.workspace }}" -B build -DYAML_BUILD_SHARED_LIBS=${{ env.YAML_BUILD_SHARED_LIBS }} -DYAML_CPP_BUILD_TESTS=${{ env.YAML_CPP_BUILD_TESTS }} + cd build && cmake --build . --parallel ${{ steps.cpu-cores.outputs.count }} + + - name: Run Tests + shell: bash + run: | + cd build && ctest -C Debug --output-on-failure --verbose bazel-build: strategy: diff --git a/CMakeLists.txt b/CMakeLists.txt index 42e3bf7..6ef6e8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,27 +18,23 @@ include(CMakePackageConfigHelpers) include(CMakeDependentOption) include(CheckCXXCompilerFlag) include(GNUInstallDirs) +include(CTest) option(YAML_CPP_BUILD_CONTRIB "Enable yaml-cpp contrib in library" ON) option(YAML_CPP_BUILD_TOOLS "Enable parse tools" ON) option(YAML_BUILD_SHARED_LIBS "Build yaml-cpp shared library" ${BUILD_SHARED_LIBS}) option(YAML_CPP_INSTALL "Enable generation of yaml-cpp install targets" ${YAML_CPP_MAIN_PROJECT}) option(YAML_CPP_FORMAT_SOURCE "Format source" ON) - -if (YAML_CPP_BUILD_TESTS) - include(CTest) -endif() - -if (YAML_CPP_FORMAT_SOURCE) - find_program(YAML_CPP_CLANG_FORMAT_EXE NAMES clang-format) -endif() - cmake_dependent_option(YAML_CPP_BUILD_TESTS - "Enable yaml-cpp tests" ON - "BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF) + "Enable yaml-cpp tests" OFF + "BUILD_TESTING;YAML_CPP_MAIN_PROJECT" OFF) cmake_dependent_option(YAML_MSVC_SHARED_RT "MSVC: Build yaml-cpp with shared runtime libs (/MD)" ON "CMAKE_SYSTEM_NAME MATCHES Windows" OFF) + +if (YAML_CPP_FORMAT_SOURCE) + find_program(YAML_CPP_CLANG_FORMAT_EXE NAMES clang-format) +endif() if (YAML_BUILD_SHARED_LIBS) set(yaml-cpp-type SHARED) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6735d35..351b03f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -46,7 +46,7 @@ if (NOT DEFINED CMAKE_CXX_STANDARD) endif() -add_test(yaml-cpp::test yaml-cpp-tests) +add_test(NAME yaml-cpp::test COMMAND yaml-cpp-tests) if (build-windows-dll) add_custom_command( From 55a8037daae6f3b96c6a6fcf62eb5426c11d0550 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Sat, 4 Mar 2023 21:07:09 +0100 Subject: [PATCH 12/15] (appveyor) remove, because testing windows in GH actions (#1176) --- appveyor.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 54bcc80..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 1.0.{build} - -environment: - matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - CMAKE_GENERATOR: Visual Studio 14 2015 - CMAKE_PLATFORM: win32 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - CMAKE_GENERATOR: Visual Studio 14 2015 - CMAKE_PLATFORM: x64 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - CMAKE_GENERATOR: Visual Studio 15 2017 - CMAKE_PLATFORM: win32 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - CMAKE_GENERATOR: Visual Studio 15 2017 - CMAKE_PLATFORM: x64 - -before_build: - - cmd: mkdir build - - cmd: cd build - - cmd: cmake .. -G "%CMAKE_GENERATOR%" -DCMAKE_GENERATOR_PLATFORM=%CMAKE_PLATFORM% - - cmd: cd .. - -build_script: - - cmake --build build -test_script: - - cmd: cd build - - ctest From 987a60425611bfd02a90bd247d630483bceaaeee Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Sat, 4 Mar 2023 23:18:51 +0100 Subject: [PATCH 13/15] Delete .travis.yml (#1177) --- .travis.yml | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 46beb1d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: c++ - -matrix: - include: - - os: linux - compiler: gcc - - os: osx - compiler: clang - - os: osx - compiler: gcc -env: - - CTEST_OUTPUT_ON_FAILURE=1 - -before_script: - - mkdir build - - cd build - - cmake .. - - cd .. -script: - - cmake --build build - - cmake --build build --target test - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.9 - packages: - - g++-4.9 - - clang-3.9 - update: true - homebrew: - packages: - - ccache - - gcc@4.9 - - llvm@4 - update: true From 74f63c1181533923d5312596ba06b4fc8d10a387 Mon Sep 17 00:00:00 2001 From: Jelin <37699558+skjsnb@users.noreply.github.com> Date: Wed, 22 Mar 2023 00:24:19 +0800 Subject: [PATCH 14/15] Move CTest to test entry (#1181) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ef6e8a..428f527 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,6 @@ include(CMakePackageConfigHelpers) include(CMakeDependentOption) include(CheckCXXCompilerFlag) include(GNUInstallDirs) -include(CTest) option(YAML_CPP_BUILD_CONTRIB "Enable yaml-cpp contrib in library" ON) option(YAML_CPP_BUILD_TOOLS "Enable parse tools" ON) @@ -179,6 +178,7 @@ endif() unset(CONFIG_EXPORT_DIR) if(YAML_CPP_BUILD_TESTS) + include(CTest) add_subdirectory(test) endif() From 0e6e28d1a38224fc8172fae0109ea7f673c096db Mon Sep 17 00:00:00 2001 From: Jesse Beder Date: Wed, 22 Mar 2023 19:14:49 -0500 Subject: [PATCH 15/15] Revert "Move CTest to test entry (#1181)" (#1182) This reverts commit 74f63c1181533923d5312596ba06b4fc8d10a387. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 428f527..6ef6e8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,7 @@ include(CMakePackageConfigHelpers) include(CMakeDependentOption) include(CheckCXXCompilerFlag) include(GNUInstallDirs) +include(CTest) option(YAML_CPP_BUILD_CONTRIB "Enable yaml-cpp contrib in library" ON) option(YAML_CPP_BUILD_TOOLS "Enable parse tools" ON) @@ -178,7 +179,6 @@ endif() unset(CONFIG_EXPORT_DIR) if(YAML_CPP_BUILD_TESTS) - include(CTest) add_subdirectory(test) endif()