Skip to content

Commit

Permalink
upgrade to catch2 version 3.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
henryborchers committed Oct 27, 2023
1 parent f9e2dab commit 814bb98
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 21 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ FetchContent_Declare(libpybind11
)

FetchContent_Declare(libcatch2
URL https://github.com/catchorg/Catch2/archive/v2.13.6.tar.gz
URL_HASH SHA1=421f3fc2ffda0cd9a52490fbc1834ff432d03084
URL https://github.com/catchorg/Catch2/archive/v3.4.0.tar.gz
URL_HASH SHA1=4c308576c856a43dc88949a8f64ef90ebf94ae1b
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)

Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -1369,8 +1369,8 @@ pipeline {
script: '''mkdir -p reports/coverage
coverage combine
coverage xml -o ./reports/coverage/coverage-python.xml
gcovr --root . --filter src/py3exiv2bind --exclude-directories build/python/temp/conan_cache --exclude-unreachable-branches --exclude-throw-branches --print-summary --keep --json -o reports/coverage/coverage-c-extension.json
gcovr --root . --filter src/py3exiv2bind --exclude-throw-branches --exclude-unreachable-branches --print-summary --keep --json -o reports/coverage/coverage_cpp.json
gcovr --root . --filter src/py3exiv2bind --exclude-directories build/cpp/_deps/libcatch2-build --exclude-directories build/python/temp/conan_cache --print-summary --keep --json -o reports/coverage/coverage-c-extension.json
gcovr --root . --filter src/py3exiv2bind --exclude-directories build/cpp/_deps/libcatch2-build --print-summary --keep --json -o reports/coverage/coverage_cpp.json
gcovr --add-tracefile reports/coverage/coverage-c-extension.json --add-tracefile reports/coverage/coverage_cpp.json --keep --print-summary --xml -o reports/coverage/coverage_cpp.xml
'''
)
Expand Down
11 changes: 4 additions & 7 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,9 @@ if (BUILD_TESTING)

FetchContent_MakeAvailable(libcatch2)
FetchContent_GetProperties(libcatch2)
list(APPEND CMAKE_MODULE_PATH ${libcatch2_SOURCE_DIR}/contrib/)
include(${libcatch2_SOURCE_DIR}/contrib/Catch.cmake)
target_include_directories(Catch2 INTERFACE ${libcatch2_SOURCE_DIR}/single_include/catch2)
target_include_directories(Catch2 INTERFACE ${libcatch2_SOURCE_DIR}/src)
add_executable(cpp_tests
test_basic.cpp
tests-main.cpp
$<TARGET_OBJECTS:glue>
# test_metadata_processor.cpp
# test_editing.cpp
Expand All @@ -73,20 +70,20 @@ if (BUILD_TESTING)
CXX_STANDARD 17
)
target_include_directories(cpp_tests PRIVATE ${PROJECT_SOURCE_DIR}/src/py3exiv2bind/core)
target_link_libraries(cpp_tests PRIVATE Catch2::Catch2 exiv2lib)
target_link_libraries(cpp_tests PRIVATE Catch2::Catch2WithMain exiv2lib)
include(Catch)

catch_discover_tests(cpp_tests TEST_PREFIX ${PROJECT_NAME}::test-pyexiv2::)
add_executable(test_editing
test_editing.cpp
# test_simple_edit.cpp
tests-main.cpp
)

set_target_properties(test_editing PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
CXX_STANDARD 17
)
target_link_libraries(test_editing PRIVATE exiv2lib Catch2::Catch2)
target_link_libraries(test_editing PRIVATE exiv2lib Catch2::Catch2WithMain)
target_compile_definitions(test_editing PRIVATE TEST_IMAGE_PATH="${TEST_IMAGE_PATH}")

endif ()
4 changes: 3 additions & 1 deletion tests/test-core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#include <iostream>
#include <fstream>
#include <string>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include <catch2/matchers/catch_matchers_all.hpp>
#include "glue/glue.h"
#include "glue/Image.h"
#include <regex>
Expand Down
2 changes: 1 addition & 1 deletion tests/test_basic.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Created by hborcher on 10/6/2017.
//
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <glue/glue.h>
#include <glue/Image.h>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion tests/test_editing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Created by hborcher on 10/4/2018.
//

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <exiv2/exiv2.hpp>
#include <cassert>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion tests/test_make_dictionary.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Created by Borchers, Henry Samuel on 7/1/21.
//
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <exiv2/exif.hpp>
#include <map>
#include <glue/make_dictionary.h>
Expand Down
6 changes: 0 additions & 6 deletions tests/tests-main.cpp

This file was deleted.

0 comments on commit 814bb98

Please sign in to comment.