From dc51f5d236665fa57e9c7fae0ceec4beb8d1213e Mon Sep 17 00:00:00 2001 From: Vincent Mallet Date: Tue, 23 Mar 2021 16:33:52 -0700 Subject: [PATCH 1/2] Better visibility for C tests: - turn on output-on-failure by default - explain how to run tests in README --- CMakeLists.txt | 1 + README.md | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8be2213..85a1e5a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,6 +184,7 @@ ENDIF () IF (MSGPACK_BUILD_TESTS) ENABLE_TESTING () + list(APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure") # MEMORYCHECK_COMMAND_OPTIONS needs to place prior to CTEST_MEMORYCHECK_COMMAND SET (MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --show-leak-kinds=definite,possible --error-exitcode=1") FIND_PROGRAM(CTEST_MEMORYCHECK_COMMAND NAMES valgrind) diff --git a/README.md b/README.md index c5a7b575..73eb06f1 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,10 @@ How to build: $ make $ sudo make install +How to run tests: + + $ make test + When you use the C part of `msgpack-c`, you need to build and link the library. By default, both static/shared libraries are built. If you want to build only static library, set `BUILD_SHARED_LIBS=OFF` to cmake. If you want to build only shared library, set `BUILD_SHARED_LIBS=ON`. #### GUI on Windows From fa7bb8ec77bcce42d36453f93769376614c7cd87 Mon Sep 17 00:00:00 2001 From: Vincent Mallet Date: Tue, 23 Mar 2021 17:05:54 -0700 Subject: [PATCH 2/2] README: make reference to gtest --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 73eb06f1..471dc87b 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,9 @@ How to build: How to run tests: +In order to run tests you must have the [GoogleTest](https://github.com/google/googletest) framework installed. If you do not currently have it, install it and re-run `cmake`. +Then: + $ make test When you use the C part of `msgpack-c`, you need to build and link the library. By default, both static/shared libraries are built. If you want to build only static library, set `BUILD_SHARED_LIBS=OFF` to cmake. If you want to build only shared library, set `BUILD_SHARED_LIBS=ON`.