Skip to content

Commit

Permalink
add tdb_catch.h wrapper for catch.hpp (#3390)
Browse files Browse the repository at this point in the history
* add tdb_catch.h wrapper to aid transition to new/mixed catch2/3 versions in build environments

* locate tdb_catch.h in test/support (a new [sub-]directory)
  • Loading branch information
dhoke4tdb authored Aug 2, 2022
1 parent c51ebe9 commit d48f874
Show file tree
Hide file tree
Showing 190 changed files with 255 additions and 209 deletions.
2 changes: 1 addition & 1 deletion experimental/tiledb/common/dag/execution/test/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
*/

#define CATCH_CONFIG_MAIN
#include <catch.hpp>
#include <test/support/tdb_catch.h>
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* Tests the threadpool class.
*/

#include "catch.hpp"
#include <test/support/tdb_catch.h>
#include "experimental/tiledb/common/dag/execution/threadpool.h"

// using namespace tiledb::common;
Expand Down
2 changes: 1 addition & 1 deletion experimental/tiledb/common/dag/ports/test/unit_fsm.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@

#ifndef TILEDB_UNIT_FSM_H
#define TILEDB_UNIT_FSM_H
#include <catch.hpp>
#include <test/support/tdb_catch.h>
#endif // TILEDB_UNIT_FSM_H
2 changes: 1 addition & 1 deletion experimental/tiledb/common/dag/ports/test/unit_ports.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@

#ifndef TILEDB_UNIT_PORTS_H
#define TILEDB_UNIT_PORTS_H
#include <catch.hpp>
#include <test/support/tdb_catch.h>
#endif // TILEDB_UNIT_PORTS_H
2 changes: 1 addition & 1 deletion experimental/tiledb/common/dag/utils/test/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
*/

#define CATCH_CONFIG_MAIN
#include <catch.hpp>
#include <test/support/tdb_catch.h>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <vector>
#include "external/include/span/span.hpp"

#include "catch.hpp"
#include <test/support/tdb_catch.h>
#include "experimental/tiledb/common/dag/utils/range_join.h"

using namespace tiledb::common;
Expand Down
2 changes: 1 addition & 1 deletion experimental/tiledb/common/dag/utils/test/unit_spinlock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* Implement tests for spinlocks.
*/

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <future>
#include <mutex>
#include <vector>
Expand Down
7 changes: 6 additions & 1 deletion test/ci/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ add_executable(
test_assert.cc
)

target_include_directories(test_assert
PRIVATE
"${TILEDB_CORE_INCLUDE_DIR}"
)

target_link_libraries(test_assert PUBLIC Catch2::Catch2)

if (TILEDB_ASSERTIONS)
Expand Down Expand Up @@ -41,4 +46,4 @@ add_dependencies(test_assert try_assert)
add_test(
NAME "test_ci_asserts"
COMMAND test_assert
)
)
2 changes: 1 addition & 1 deletion test/ci/test_assert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/

#define CATCH_CONFIG_MAIN
#include <catch.hpp>
#include <test/support/tdb_catch.h>

#include <cassert>
#include <iostream>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* Tests the CPP API consolidation with timestamps.
*/

#include "catch.hpp"
#include <test/support/tdb_catch.h>
#include "test/src/helpers.h"
#include "tiledb/sm/array/array_directory.h"
#include "tiledb/sm/c_api/tiledb_struct_def.h"
Expand Down
2 changes: 1 addition & 1 deletion test/performance/msys_handle_leakage/unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ after 70
*/

#define CATCH_CONFIG_RUNNER
#include <catch.hpp>
#include <test/support/tdb_catch.h>

#include <cstdlib>
#include <iostream>
Expand Down
3 changes: 3 additions & 0 deletions test/regression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
# THE SOFTWARE.
#

set(TILEDB_CORE_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..")

find_package(Catch_EP REQUIRED)

set(SOURCES
Expand Down Expand Up @@ -61,6 +63,7 @@ target_link_libraries(tiledb_regression
target_include_directories(tiledb_regression
PRIVATE
${CMAKE_INSTALL_PREFIX}/include
"${TILEDB_CORE_INCLUDE_DIR}"
)

add_test(
Expand Down
2 changes: 1 addition & 1 deletion test/regression/regression.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define CATCH_CONFIG_RUNNER
#include <catch.hpp>
#include <test/support/tdb_catch.h>

int main(const int argc, char** const argv) {
Catch::Session session;
Expand Down
2 changes: 1 addition & 1 deletion test/regression/targets/sc-12024.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <tiledb/tiledb>

#include "catch.hpp"
#include <test/support/tdb_catch.h>

#include <chrono>
#include <thread>
Expand Down
2 changes: 1 addition & 1 deletion test/regression/targets/sc-15387.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <tiledb/tiledb>

#include "catch.hpp"
#include <test/support/tdb_catch.h>

#include <chrono>
#include <thread>
Expand Down
2 changes: 1 addition & 1 deletion test/regression/targets/sc-18250.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <tiledb/tiledb.h>
#include <tiledb/tiledb_serialization.h>

#include "catch.hpp"
#include <test/support/tdb_catch.h>

static const char* schema_str = R"rstr(
{"arrayType":"dense","attributes":[{
Expand Down
2 changes: 1 addition & 1 deletion test/regression/targets/sc-18836.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <tiledb/tiledb>
#include <future>

#include "catch.hpp"
#include <test/support/tdb_catch.h>

using namespace tiledb;

Expand Down
2 changes: 1 addition & 1 deletion test/regression/targets/sc-19240_cppapi-vfs-exception.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <iostream>
#include <tiledb/tiledb>

#include "catch.hpp"
#include <test/support/tdb_catch.h>

TEST_CASE(
"C++ API: test exception handling in VFSFileBuf interface",
Expand Down
2 changes: 1 addition & 1 deletion test/src/cpp-integration-query-condition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <iostream>
#include <vector>

#include "catch.hpp"
#include <test/support/tdb_catch.h>
#include "tiledb/sm/cpp_api/tiledb"
#include "tiledb/sm/misc/utils.h"

Expand Down
2 changes: 1 addition & 1 deletion test/src/helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/

#include "helpers.h"
#include "catch.hpp"
#include <test/support/tdb_catch.h>
#include "serialization_wrappers.h"
#include "tiledb/common/logger.h"
#include "tiledb/sm/c_api/tiledb_struct_def.h"
Expand Down
2 changes: 1 addition & 1 deletion test/src/serialization_wrappers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
* through serialization.
*/

#include <test/support/tdb_catch.h>
#include <string>
#include "catch.hpp"
#include "tiledb/sm/c_api/tiledb.h"
#include "tiledb/sm/c_api/tiledb_serialization.h"

Expand Down
2 changes: 1 addition & 1 deletion test/src/test-capi-dimension_labels.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>
#include <string>
#include <unordered_map>
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-CellSlabIter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::sm;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-DenseTiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "tiledb/sm/cpp_api/tiledb"
#include "tiledb/sm/query/writers/dense_tiler.h"

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-QueryCondition-serialization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include "tiledb/sm/enums/query_condition_op.h"
#include "tiledb/sm/query/query_condition.h"

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::sm;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-ReadCellSlabIter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::sm;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-Reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::sm;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-Subarray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::sm;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-SubarrayPartitioner-dense.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::common;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-SubarrayPartitioner-error.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::common;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-SubarrayPartitioner-sparse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "tiledb/sm/filesystem/posix.h"
#endif

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::common;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-Tile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "tiledb/sm/enums/datatype.h"
#include "tiledb/sm/tile/tile.h"

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::sm;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-TileDomain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* Tests for class TileDomain.
*/

#include "catch.hpp"
#include <test/support/tdb_catch.h>
#include "tiledb/sm/array_schema/tile_domain.h"

using namespace tiledb::sm;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-arrow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* Tests for the TileDB Arrow integration.
*/

#include "catch.hpp"
#include <test/support/tdb_catch.h>
#include "helpers.h"
#include "tiledb/sm/cpp_api/arrowio"
#include "tiledb/sm/cpp_api/tiledb"
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-azure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#ifdef HAVE_AZURE

#include "catch.hpp"
#include <test/support/tdb_catch.h>
#include "tiledb/common/filesystem/directory_entry.h"
#include "tiledb/common/thread_pool.h"
#include "tiledb/sm/config/config.h"
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-backwards_compat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* Tests of backwards compatibility for opening/reading arrays.
*/

#include "catch.hpp"
#include <test/support/tdb_catch.h>
#include "test/src/helpers.h"
#include "tiledb/common/common.h"
#include "tiledb/sm/cpp_api/tiledb"
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-bufferlist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "tiledb/sm/c_api/tiledb.h"
#include "tiledb/sm/c_api/tiledb_struct_def.h"

#include <catch.hpp>
#include <test/support/tdb_catch.h>
#include <iostream>

using namespace tiledb::sm;
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-bytevecvalue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "test/src/helpers.h"
#include "tiledb/sm/misc/types.h"

#include "catch.hpp"
#include <test/support/tdb_catch.h>

using namespace tiledb::sm;

Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-capi-any.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* Tests for TileDB's ANY datatype at the C API level.
*/

#include "catch.hpp"
#include <test/support/tdb_catch.h>
#include "tiledb/sm/c_api/tiledb.h"

#include <cstring>
Expand Down
5 changes: 2 additions & 3 deletions test/src/unit-capi-array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@
* Tests of C API for (dense or sparse) array operations.
*/

#include "catch.hpp"
#include "tiledb/sm/c_api/tiledb.h"

#include <iostream>

#include "catch.hpp"
#include <test/support/tdb_catch.h>
#include "test/src/helpers.h"
#include "test/src/vfs_helpers.h"
#ifdef _WIN32
Expand Down Expand Up @@ -2168,4 +2167,4 @@ TEST_CASE_METHOD(

remove_temp_dir(local_fs.file_prefix() + local_fs.temp_dir());
#endif
}
}
2 changes: 1 addition & 1 deletion test/src/unit-capi-array_schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <sstream>
#include <thread>

#include "catch.hpp"
#include <test/support/tdb_catch.h>
#include "test/src/helpers.h"
#include "test/src/vfs_helpers.h"
#ifdef _WIN32
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-capi-async.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* Tests the C API async queries.
*/

#include "catch.hpp"
#include <test/support/tdb_catch.h>
#include "test/src/helpers.h"
#include "tiledb/sm/c_api/tiledb.h"

Expand Down
Loading

0 comments on commit d48f874

Please sign in to comment.