Consolidated the CMake project.
- Moved everything to one CMakeLists.txt
- Added support for the json_process test suites (instead of just the API
tests).
- Changed to use the modified json_process version that does away with the
environment variables (originally written by DanielT).
- Had to exclude "test_memory_funcs" on MSVC, since void pointer
arithmetics are not allowed as it is done in secure_malloc and
secure_free.
- Had to add a check for "ssize_t". This is not available on Windows and
maybe on some other platforms (used in test_pack.c)
- Result from running ctest (The failure seems unrelated to CMake, it's
just that the expected result is in a different order):
99% tests passed, 1 tests failed out of 121
Total Test time (real) = 1.31 sec
The following tests FAILED:
24 - valid__complex-array (Failed)
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
set (tests
|
||||
test_array
|
||||
test_copy
|
||||
test_dump
|
||||
test_dump_callback
|
||||
test_equal
|
||||
test_load
|
||||
test_loadb
|
||||
test_memory_funcs
|
||||
test_number
|
||||
test_object
|
||||
test_pack
|
||||
test_simple
|
||||
test_unpack)
|
||||
|
||||
foreach (test ${tests})
|
||||
add_executable (${test} ${test}.c)
|
||||
target_link_libraries (${test} jansson)
|
||||
endforeach()
|
||||
|
||||
# batch plain tests
|
||||
foreach (test ${tests})
|
||||
add_test (${test} ${CMAKE_CURRENT_BINARY_DIR}/${test})
|
||||
endforeach()
|
||||
|
||||
# batch valgrind tests
|
||||
if (TEST_WITH_VALGRIND)
|
||||
foreach (test ${tests})
|
||||
add_test (memcheck_${test} ${MEMCHECK_COMMAND} ${CMAKE_CURRENT_BINARY_DIR}/${test})
|
||||
endforeach()
|
||||
endif ()
|
||||
@@ -6,6 +6,12 @@
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <jansson_config.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <jansson.h>
|
||||
#include <stdio.h>
|
||||
|
||||
Reference in New Issue
Block a user