From 41f434e89f1cfb75b174ea0b4dbc88edec29522c Mon Sep 17 00:00:00 2001 From: Eric Haszlakiewicz Date: Sat, 23 Nov 2019 23:55:04 -0500 Subject: [PATCH] Fix test_util_file for VS2013 too, but skip all the tests for anything older than that because the limitations are too inconvenient. --- CMakeLists.txt | 4 +++- tests/test_util_file.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 48de72a..b70ad1e 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 65be9b9..3cc246d 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); -- 2.49.0