Skip to content

Commit

Permalink
Merge pull request #267 from pinotree/system-catch2
Browse files Browse the repository at this point in the history
Use Catch2 as installed
  • Loading branch information
arximboldi authored Aug 2, 2023
2 parents b70f1c2 + eec8507 commit b60403c
Show file tree
Hide file tree
Showing 47 changed files with 50 additions and 18,002 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ endif()
if (immer_BUILD_TESTS)
enable_testing()

find_package(Catch2 REQUIRED)

add_custom_target(check
COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
Expand Down
4 changes: 4 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
dontBuild = true;
dontUseCmakeBuildDir = true;
cmakeFlags = [
"-Dimmer_BUILD_TESTS=OFF"
"-Dimmer_BUILD_EXAMPLES=OFF"
];
meta = {
homepage = "https://github.com/arximboldi/immer";
description = "Postmodern immutable data structures for C++";
Expand Down
1 change: 1 addition & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ tc.stdenv.mkDerivation rec {
buildInputs = [
tc.cc
git
catch2
cmake
pkgconfig
ninja
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ foreach(_file IN LISTS immer_unit_tests)
target_compile_definitions(${_target} PUBLIC
-DIMMER_OSS_FUZZ_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/oss-fuzz/data"
CATCH_CONFIG_MAIN)
target_link_libraries(${_target} PUBLIC immer-dev)
target_link_libraries(${_target} PUBLIC immer-dev Catch2::Catch2)
add_test("test/${_output}" ${_output})
endforeach()
2 changes: 1 addition & 1 deletion test/algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <immer/algorithm.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

struct thing
{
Expand Down
2 changes: 1 addition & 1 deletion test/atom/generic.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#error "define the box template to use in ATOM_T"
#endif

#include <catch.hpp>
#include <catch2/catch.hpp>

template <typename T>
using BOX_T = typename ATOM_T<T>::box_type;
Expand Down
2 changes: 1 addition & 1 deletion test/box/generic.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#error "define the box template to use in BOX_T"
#endif

#include <catch.hpp>
#include <catch2/catch.hpp>

TEST_CASE("construction and copy")
{
Expand Down
2 changes: 1 addition & 1 deletion test/box/recursive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <immer/set.hpp>
#include <immer/vector.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

struct rec_vec
{
Expand Down
2 changes: 1 addition & 1 deletion test/box/vector-of-boxes-transient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <immer/vector.hpp>
#include <immer/vector_transient.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

TEST_CASE("issue-33")
{
Expand Down
2 changes: 1 addition & 1 deletion test/detail/type_traits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//

#include <catch.hpp>
#include <catch2/catch.hpp>
#include <forward_list>
#include <immer/detail/type_traits.hpp>
#include <list>
Expand Down
2 changes: 1 addition & 1 deletion test/experimental/dvektor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <vector>
#include <iostream>

#include <catch.hpp>
#include <catch2/catch.hpp>

using namespace immer;

Expand Down
2 changes: 1 addition & 1 deletion test/flex_vector/fuzzed-0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "extra/fuzzer/fuzzer_input.hpp"
#include <array>
#include <catch.hpp>
#include <catch2/catch.hpp>
#include <immer/flex_vector.hpp>
#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion test/flex_vector/fuzzed-1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "extra/fuzzer/fuzzer_input.hpp"
#include <array>
#include <catch.hpp>
#include <catch2/catch.hpp>
#include <immer/flex_vector.hpp>
#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion test/flex_vector/fuzzed-2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "extra/fuzzer/fuzzer_input.hpp"
#include <array>
#include <catch.hpp>
#include <catch2/catch.hpp>
#include <immer/flex_vector.hpp>
#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion test/flex_vector/fuzzed-3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "extra/fuzzer/fuzzer_input.hpp"
#include <array>
#include <catch.hpp>
#include <catch2/catch.hpp>
#include <immer/flex_vector.hpp>
#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion test/flex_vector/fuzzed-4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "extra/fuzzer/fuzzer_input.hpp"
#include <array>
#include <catch.hpp>
#include <catch2/catch.hpp>
#include <immer/flex_vector.hpp>
#include <immer/flex_vector_transient.hpp>
#include <immer/heap/gc_heap.hpp>
Expand Down
2 changes: 1 addition & 1 deletion test/flex_vector/generic.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>
#include <catch.hpp>
#include <catch2/catch.hpp>

#include <algorithm>
#include <array>
Expand Down
2 changes: 1 addition & 1 deletion test/flex_vector/issue-45.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <immer/vector.hpp>
#include <immer/vector_transient.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

#if IMMER_CXX_STANDARD >= 17

Expand Down
2 changes: 1 addition & 1 deletion test/flex_vector_transient/generic.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>
#include <catch.hpp>
#include <catch2/catch.hpp>

#include <algorithm>
#include <array>
Expand Down
2 changes: 1 addition & 1 deletion test/map/generic.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "test/dada.hpp"
#include "test/util.hpp"

#include <catch.hpp>
#include <catch2/catch.hpp>

#include <random>
#include <unordered_map>
Expand Down
2 changes: 1 addition & 1 deletion test/map/issue-56.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <immer/map.hpp>
#include <immer/vector.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

TEST_CASE("const map")
{
Expand Down
2 changes: 1 addition & 1 deletion test/map_transient/generic.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "test/util.hpp"

#include <catch.hpp>
#include <catch2/catch.hpp>

#ifndef MAP_T
#error "define the map template to use in MAP_T"
Expand Down
2 changes: 1 addition & 1 deletion test/memory/heaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <immer/heap/malloc_heap.hpp>
#include <immer/heap/thread_local_free_list_heap.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>
#include <numeric>

void do_stuff_to(void* buf, std::size_t size)
Expand Down
2 changes: 1 addition & 1 deletion test/memory/refcounts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <immer/refcount/refcount_policy.hpp>
#include <immer/refcount/unsafe_refcount_policy.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

TEST_CASE("no refcount has no data")
{
Expand Down
2 changes: 1 addition & 1 deletion test/oss-fuzz/array-0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include <immer/array.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

namespace {

Expand Down
2 changes: 1 addition & 1 deletion test/oss-fuzz/array-gc-0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <immer/heap/gc_heap.hpp>
#include <immer/refcount/no_refcount_policy.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

using gc_memory = immer::memory_policy<immer::heap_policy<immer::gc_heap>,
immer::no_refcount_policy,
Expand Down
2 changes: 1 addition & 1 deletion test/oss-fuzz/flex-vector-0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <immer/flex_vector.hpp>
#include <immer/refcount/no_refcount_policy.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

#define IMMER_FUZZED_TRACE_ENABLE 0

Expand Down
2 changes: 1 addition & 1 deletion test/oss-fuzz/flex-vector-bo-0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <immer/flex_vector.hpp>
#include <immer/flex_vector_transient.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

#define IMMER_FUZZED_TRACE_ENABLE 1

Expand Down
2 changes: 1 addition & 1 deletion test/oss-fuzz/flex-vector-gc-0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <immer/heap/gc_heap.hpp>
#include <immer/refcount/no_refcount_policy.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

#define IMMER_FUZZED_TRACE_ENABLE 0

Expand Down
2 changes: 1 addition & 1 deletion test/oss-fuzz/map-gc-0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <immer/map.hpp>
#include <immer/refcount/no_refcount_policy.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

using gc_memory = immer::memory_policy<immer::heap_policy<immer::gc_heap>,
immer::no_refcount_policy,
Expand Down
2 changes: 1 addition & 1 deletion test/oss-fuzz/map-st-0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <immer/heap/gc_heap.hpp>
#include <immer/map.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

using st_memory = immer::memory_policy<immer::heap_policy<immer::cpp_heap>,
immer::unsafe_refcount_policy,
Expand Down
2 changes: 1 addition & 1 deletion test/oss-fuzz/map-st-1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <immer/heap/gc_heap.hpp>
#include <immer/map.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

using st_memory = immer::memory_policy<immer::heap_policy<immer::cpp_heap>,
immer::unsafe_refcount_policy,
Expand Down
2 changes: 1 addition & 1 deletion test/oss-fuzz/map-st-2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <immer/heap/gc_heap.hpp>
#include <immer/map.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

#define IMMER_FUZZED_TRACE_ENABLE 0

Expand Down
2 changes: 1 addition & 1 deletion test/oss-fuzz/map-st-str-0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include <array>

#include <catch.hpp>
#include <catch2/catch.hpp>

#define IMMER_FUZZED_TRACE_ENABLE 1

Expand Down
2 changes: 1 addition & 1 deletion test/oss-fuzz/set-gc-0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <immer/refcount/no_refcount_policy.hpp>
#include <immer/set.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

using gc_memory = immer::memory_policy<immer::heap_policy<immer::gc_heap>,
immer::no_refcount_policy,
Expand Down
2 changes: 1 addition & 1 deletion test/oss-fuzz/set-gc-1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include <immer/algorithm.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

#define IMMER_FUZZED_TRACE_ENABLE 0

Expand Down
2 changes: 1 addition & 1 deletion test/oss-fuzz/set-st-0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include <array>

#include <catch.hpp>
#include <catch2/catch.hpp>

using st_memory = immer::memory_policy<immer::heap_policy<immer::cpp_heap>,
immer::unsafe_refcount_policy,
Expand Down
2 changes: 1 addition & 1 deletion test/oss-fuzz/set-st-str-0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include <array>

#include <catch.hpp>
#include <catch2/catch.hpp>

namespace {

Expand Down
2 changes: 1 addition & 1 deletion test/set/generic.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <immer/algorithm.hpp>
#include <immer/box.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

#include <random>
#include <unordered_set>
Expand Down
2 changes: 1 addition & 1 deletion test/set_transient/generic.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "test/util.hpp"

#include <catch.hpp>
#include <catch2/catch.hpp>

#ifndef SET_T
#error "define the set template to use in SET_T"
Expand Down
2 changes: 1 addition & 1 deletion test/table/generic.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "test/dada.hpp"
#include "test/util.hpp"

#include <catch.hpp>
#include <catch2/catch.hpp>

#include <random>
#include <unordered_map>
Expand Down
2 changes: 1 addition & 1 deletion test/table_transient/generic.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "test/util.hpp"

#include <catch.hpp>
#include <catch2/catch.hpp>

#ifndef SETUP_T
#error "define the table types via SETUP_T macro"
Expand Down
2 changes: 1 addition & 1 deletion test/vector/generic.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <immer/algorithm.hpp>

#include <boost/range/adaptors.hpp>
#include <catch.hpp>
#include <catch2/catch.hpp>

#include <algorithm>
#include <numeric>
Expand Down
2 changes: 1 addition & 1 deletion test/vector/issue-177.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <immer/vector.hpp>
#include <immer/vector_transient.hpp>

#include <catch.hpp>
#include <catch2/catch.hpp>

struct object;

Expand Down
Loading

0 comments on commit b60403c

Please sign in to comment.