From: Eric Haszlakiewicz Date: Sun, 24 Nov 2019 04:55:04 +0000 (-0500) Subject: Fix test_util_file for VS2013 too, but skip all the tests for anything older than... X-Git-Tag: json-c-0.14-20200419~74 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41f434e89f1cfb75b174ea0b4dbc88edec29522c;p=thirdparty%2Fjson-c.git Fix test_util_file for VS2013 too, but skip all the tests for anything older than that because the limitations are too inconvenient. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 48de72ae..b70ad1ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,9 @@ endif() include(CTest) -if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING) +if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING AND + (NOT MSVC OR NOT (MSVC_VERSION LESS 1800)) # Tests need at least VS2013 + ) add_subdirectory(tests) endif() diff --git a/tests/test_util_file.c b/tests/test_util_file.c index 65be9b93..3cc246d2 100644 --- a/tests/test_util_file.c +++ b/tests/test_util_file.c @@ -19,6 +19,7 @@ #include "json.h" #include "json_util.h" +#include "snprintf_compat.h" static void test_read_valid_with_fd(const char *testdir); static void test_read_valid_nested_with_fd(const char *testdir);