Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Catch Version 3 #137

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ nwx_cxx_api_docs("README.md" "${project_inc_dir}" "${project_src_dir}")
cmaize_find_or_build_dependency(
spdlog
URL github.com/gabime/spdlog
VERSION ${NWX_SPDLOG_VERSION}
VERSION ad0e89cbfb4d0c1ce4d097e134eb7be67baebb36
BUILD_TARGET spdlog
FIND_TARGET spdlog::spdlog
CMAKE_ARGS SPDLOG_INSTALL=ON
Expand All @@ -78,7 +78,7 @@ endif ()
cmaize_find_or_build_dependency(
cereal
URL github.com/USCiLab/cereal
VERSION ${NWX_CEREAL_VERSION}
VERSION v1.3.0
BUILD_TARGET cereal
FIND_TARGET cereal
CMAKE_ARGS JUST_INSTALL_CEREAL=ON
Expand Down Expand Up @@ -109,20 +109,14 @@ if("${BUILD_TESTING}")
URL github.com/catchorg/Catch2
BUILD_TARGET Catch2
FIND_TARGET Catch2::Catch2
VERSION ${NWX_CATCH2_VERSION}
VERSION v3.6.0
)
cmaize_add_tests(
test_unit_parallelzone
SOURCE_DIR "${CXX_TEST_DIR}/unit_tests"
INCLUDE_DIRS "${project_src_dir}"
DEPENDS Catch2::Catch2 ${PROJECT_NAME}
)
cmaize_add_tests(
test_integration_parallelzone
SOURCE_DIR "${CXX_TEST_DIR}/integration_tests"
INCLUDE_DIRS "${project_src_dir}"
DEPENDS Catch2::Catch2 ${PROJECT_NAME}
)
cmaize_add_tests(
test_parallelzone_docs
SOURCE_DIR "${CXX_TEST_DIR}/doc_snippets"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 NWChemEx-Project
* Copyright 2024 NWChemEx-Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,14 +14,8 @@
* limitations under the License.
*/

#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <iostream>

int print_and_return(int ii) {
std::cout << "This is only a blank model for an integration test."
<< std::endl;
return 0;
}

TEST_CASE("Blank test", "[classic]") { REQUIRE(print_and_return(0) == 0); }
#pragma once
#include <catch2/catch_approx.hpp>
#include <catch2/catch_session.hpp>
#include <catch2/catch_template_test_macros.hpp>
#include <catch2/catch_test_macros.hpp>
2 changes: 1 addition & 1 deletion tests/cxx/doc_snippets/test_parallelzone.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

#pragma once
#include <catch2/catch.hpp>
#include "catch.hpp"
#include <parallelzone/runtime/runtime_view.hpp>

namespace testing {
Expand Down
2 changes: 1 addition & 1 deletion tests/cxx/unit_tests/parallelzone/archive_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

#include "catch.hpp"
#include "parallelzone/archive_wrapper.hpp"
#include <catch2/catch.hpp>

TEMPLATE_TEST_CASE("Serialization with ArchiveWrapper",
"[serialization][Serializer][Deserializer]",
Expand Down
21 changes: 21 additions & 0 deletions tests/cxx/unit_tests/parallelzone/catch.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2024 NWChemEx-Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once
#include <catch2/catch_approx.hpp>
#include <catch2/catch_session.hpp>
#include <catch2/catch_template_test_macros.hpp>
#include <catch2/catch_test_macros.hpp>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include <catch2/catch.hpp>
#include "../../../catch.hpp"
#include <filesystem>
#include <parallelzone/logging/detail_/spdlog/file.hpp>
#include <parallelzone/logging/detail_/spdlog/stdout.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include <catch2/catch.hpp>
#include "../../../catch.hpp"
#include <filesystem>
#include <iostream>
#include <parallelzone/logging/detail_/spdlog/spdlog.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include <catch2/catch.hpp>
#include "../../../catch.hpp"
#include <parallelzone/logging/detail_/spdlog/stdout.hpp>
#include <spdlog/sinks/ostream_sink.h>
#include <sstream>
Expand Down
2 changes: 1 addition & 1 deletion tests/cxx/unit_tests/parallelzone/logging/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include <catch2/catch.hpp>
#include "../catch.hpp"
#include <parallelzone/logging/detail_/spdlog/spdlog.hpp>
#include <parallelzone/logging/detail_/spdlog/stdout.hpp>
#include <parallelzone/logging/logger.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include <catch2/catch.hpp>
#include "../../catch.hpp"
#include <parallelzone/mpi_helpers/binary_buffer/binary_buffer.hpp>

/* Testing Strategy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include <catch2/catch.hpp>
#include "../../catch.hpp"
#include <parallelzone/mpi_helpers/binary_buffer/binary_buffer.hpp>
#include <parallelzone/mpi_helpers/binary_buffer/binary_view.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include <catch2/catch.hpp>
#include "../../../catch.hpp"
#include <parallelzone/mpi_helpers/binary_buffer/detail_/binary_buffer_pimpl.hpp>

/* Testing Strategy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#include "../../test_parallelzone.hpp"
#include <numeric>
#include <parallelzone/mpi_helpers/commpp/commpp.hpp>

using namespace parallelzone::mpi_helpers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include <catch2/catch.hpp>
#include "../../catch.hpp"
#include <parallelzone/mpi_helpers/traits/mpi_data_type.hpp>

using namespace parallelzone::mpi_helpers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include <catch2/catch.hpp>
#include "../../catch.hpp"
#include <parallelzone/mpi_helpers/traits/mpi_op.hpp>

using namespace parallelzone::mpi_helpers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include <catch2/catch.hpp>
#include "../../catch.hpp"
#include <map>
#include <parallelzone/mpi_helpers/binary_buffer/binary_buffer.hpp>
#include <vector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include <catch2/catch.hpp>
#include "../../catch.hpp"
#include <parallelzone/logging/logger_factory.hpp>
#include <parallelzone/runtime/detail_/resource_set_pimpl.hpp>

Expand Down
2 changes: 1 addition & 1 deletion tests/cxx/unit_tests/parallelzone/serialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

#include "catch.hpp"
#include "parallelzone/serialization.hpp"
#include <catch2/catch.hpp>

TEMPLATE_TEST_CASE("Serialization with Cereal wrapper",
"[serialization][serializer][deserializer]",
Expand Down
2 changes: 1 addition & 1 deletion tests/cxx/unit_tests/parallelzone/test_parallelzone.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

#pragma once
#include <catch2/catch.hpp>
#include "catch.hpp"
#include <parallelzone/runtime/runtime_view.hpp>

namespace testing {
Expand Down
Loading