Add CMake and tests
- Port tests to GitLab - Add GitLab CI test matrix - Remove gtest submodule
This commit is contained in:
parent
7056638935
commit
f07596dbb5
19 changed files with 1760 additions and 28 deletions
12
tests/CMakeLists.txt
Normal file
12
tests/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
include(FetchContent)
|
||||
FetchContent_Declare(googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG f8d7d77c06936315286eb55f8de22cd23c188571 # v1.14.0
|
||||
)
|
||||
FetchContent_MakeAvailable(googletest)
|
||||
|
||||
include(GoogleTest)
|
||||
add_executable(c-capnproto-testcases addressbook.capnp.c capn-stream-test.cpp capn-test.cpp example-test.cpp)
|
||||
target_link_libraries(c-capnproto-testcases PRIVATE CapnC_Runtime GTest::gtest)
|
||||
|
||||
gtest_add_tests(TARGET c-capnproto-testcases)
|
||||
|
|
@ -85,7 +85,7 @@ TEST(Examples, RoundTripPerson) {
|
|||
|
||||
{
|
||||
// Write serialized object to file system.
|
||||
FILE *f = fopen("tests/example-test.cpp.Person.out", "wb");
|
||||
FILE *f = fopen("example-test.cpp.Person.out", "wb");
|
||||
ASSERT_NE(f, (void*)0);
|
||||
fwrite(buf, 1 /* size */, sz /* count */, f);
|
||||
int close_ret = fclose(f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue