From a2049c5367fe60930533a995f7ffded538f04dc4 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Tue, 14 Mar 2023 11:56:06 +0100 Subject: [PATCH] Update Catch2 to v3.2.1. (#340) --- CMakeLists.txt | 3 +-- tests/test-main.cpp | 16 ---------------- tests/test.cpp | 10 +++++++++- 3 files changed, 10 insertions(+), 19 deletions(-) delete mode 100644 tests/test-main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index d1dd25d22..a01abc8f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,12 +151,11 @@ ENDIF() FetchContent_Declare( Catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v2.13.7 + GIT_TAG v3.2.1 ) FetchContent_MakeAvailable(Catch2) add_executable(RunTests - tests/test-main.cpp tests/test.cpp src/chacha8.c ${BLAKE3_SRC} diff --git a/tests/test-main.cpp b/tests/test-main.cpp deleted file mode 100644 index 2ba713fce..000000000 --- a/tests/test-main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 Chia Network Inc - -// 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. - -#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file -#include diff --git a/tests/test.cpp b/tests/test.cpp index 3e29e6875..e2d976df4 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -16,7 +16,9 @@ #include -#include +#include +#include +#include #include "../lib/include/picosha2.hpp" #include "calculate_bucket.hpp" @@ -1168,3 +1170,9 @@ TEST_CASE("FilteredDisk") */ remove("test_file.bin"); } + +int main(int argc, char* argv[]) +{ + int result = Catch::Session().run(argc, argv); + return result; +}