Skip to content

Commit 8dc155b

Browse files
upgrade to use catch2
1 parent 1fecca6 commit 8dc155b

24 files changed

+50
-51
lines changed

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "tinyxml2"]
22
path = tinyxml2
33
url = https://github.com/leethomason/tinyxml2.git
4-
[submodule "catch"]
5-
path = catch
6-
url = https://github.com/philsquared/Catch.git
4+
[submodule "Catch2"]
5+
path = Catch2
6+
url = https://github.com/catchorg/Catch2

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ add_subdirectory (src)
3737

3838
if(BUILD_TESTS)
3939
enable_testing()
40+
add_subdirectory(Catch2)
4041
add_subdirectory (tests)
4142
endif(BUILD_TESTS)
4243

Catch2

Submodule Catch2 added at 914aeec

catch

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# endfunction(add_test_executable)
77
# Includes Catch in the project:
88
#add_subdirectory(${EXT_PROJECTS_DIR}/catch)
9-
include_directories(${PROJECT_SOURCE_DIR}/catch/include)
9+
# include_directories(${PROJECT_SOURCE_DIR}/Catch2/include)
1010

1111

1212
FASTTYPEGEN_TARGET(simple_types1 simple1.xml)
@@ -28,7 +28,6 @@ FASTTYPEGEN_TARGET(test_types5 test5.xml)
2828
FASTTYPEGEN_TARGET(test_scp scp.xml)
2929

3030
add_executable (mfast_test
31-
test_main.cpp
3231
arena_allocator_test.cpp
3332
field_ref_test.cpp
3433
fast_istream_test.cpp
@@ -63,11 +62,12 @@ add_executable (mfast_test
6362
scp_reset_test.cpp
6463
)
6564

66-
target_link_libraries (mfast_test
65+
target_link_libraries (mfast_test PRIVATE
6766
mfast_static
6867
mfast_coder_static
6968
mfast_json_static
70-
mfast_xml_parser_static)
69+
mfast_xml_parser_static
70+
Catch2::Catch2WithMain)
7171

7272

7373
if(${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")

tests/aggregate_view_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// along with mFast. If not, see <http://www.gnu.org/licenses/>.
1818
//
1919

20-
#include "catch.hpp"
20+
#include <catch2/catch_test_macros.hpp>
2121

2222
#include <sstream>
2323
#include "mfast.h"

tests/arena_allocator_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// You should have received a copy of the GNU Lesser General Public License
1717
// along with mFast. If not, see <http://www.gnu.org/licenses/>.
1818
//
19-
#include "catch.hpp"
19+
#include <catch2/catch_test_macros.hpp>
2020

2121
#include <mfast/arena_allocator.h>
2222
#include <cstring>

tests/coder_test.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
// along with mFast. If not, see <http://www.gnu.org/licenses/>.
1818
//
1919

20-
#include "catch.hpp"
21-
20+
#include <catch2/catch_test_macros.hpp>
2221
#include <mfast.h>
2322
#include <mfast/field_comparator.h>
2423
#include <mfast/xml_parser/dynamic_templates_description.h>

tests/composite_type_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// along with mFast. If not, see <http://www.gnu.org/licenses/>.
1818
//
1919

20-
#include "catch.hpp"
20+
#include <catch2/catch_test_macros.hpp>
2121

2222
#include "test4.h"
2323
#include <mfast/field_comparator.h>

tests/debug_allocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//
1919
#pragma once
2020

21-
#include "catch.hpp"
21+
#include <catch2/catch_test_macros.hpp>
2222
#include <mfast/malloc_allocator.h>
2323
#include <set>
2424
#include <cstring>

0 commit comments

Comments
 (0)