From 60ee5fc844e539466a1addbcd728730d3664e159 Mon Sep 17 00:00:00 2001 From: Furkan Usta Date: Sat, 2 May 2020 15:12:30 +0300 Subject: [PATCH 1/4] Enable numberparsingcheck and stringparsingcheck on MSVC --- tests/CMakeLists.txt | 10 ++++------ tests/numberparsingcheck.cpp | 2 +- tests/stringparsingcheck.cpp | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3c77e99ed..f83b80131 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -42,12 +42,10 @@ include(${PROJECT_SOURCE_DIR}/tests/add_cpp_test.cmake) # # These tests explicitly do #include "simdjson.cpp" so they can override stuff # -if (NOT MSVC) # Can't get simdjson-source to compile on Windows for some reason. - add_cpp_test(numberparsingcheck LABELS acceptance per_implementation) - target_link_libraries(numberparsingcheck simdjson-include-source) - add_cpp_test(stringparsingcheck LABELS acceptance per_implementation) - target_link_libraries(stringparsingcheck simdjson-include-source) -endif() +add_cpp_test(numberparsingcheck LABELS acceptance per_implementation) +target_link_libraries(numberparsingcheck simdjson-include-source simdjson-windows-headers) +add_cpp_test(stringparsingcheck LABELS acceptance per_implementation) +target_link_libraries(stringparsingcheck simdjson-include-source simdjson-windows-headers) # All remaining tests link with simdjson proper link_libraries(simdjson) diff --git a/tests/numberparsingcheck.cpp b/tests/numberparsingcheck.cpp index 5cd663b6f..c94818010 100644 --- a/tests/numberparsingcheck.cpp +++ b/tests/numberparsingcheck.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -10,6 +9,7 @@ #define JSON_TEST_NUMBERS #endif +#include "dirent_portable.h" #include "simdjson.h" // ulp distance diff --git a/tests/stringparsingcheck.cpp b/tests/stringparsingcheck.cpp index d4bda5a86..690d25c1d 100644 --- a/tests/stringparsingcheck.cpp +++ b/tests/stringparsingcheck.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include #include @@ -13,6 +12,7 @@ #define JSON_TEST_STRINGS #endif +#include "dirent_portable.h" #include "simdjson.h" char *fullpath; From 977e1a94b25d3784319f9884ed771ec7609cef33 Mon Sep 17 00:00:00 2001 From: Furkan Usta Date: Sat, 2 May 2020 15:16:50 +0300 Subject: [PATCH 2/4] Use dirent_portable.h only in MSVC --- tests/numberparsingcheck.cpp | 7 ++++++- tests/stringparsingcheck.cpp | 7 ++++++- windows/CMakeLists.txt | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/numberparsingcheck.cpp b/tests/numberparsingcheck.cpp index c94818010..2dc10214f 100644 --- a/tests/numberparsingcheck.cpp +++ b/tests/numberparsingcheck.cpp @@ -9,7 +9,12 @@ #define JSON_TEST_NUMBERS #endif -#include "dirent_portable.h" +#ifndef _MSC_VER +#include +#else +// Microsoft can't be bothered to provide standard utils. +#include +#endif #include "simdjson.h" // ulp distance diff --git a/tests/stringparsingcheck.cpp b/tests/stringparsingcheck.cpp index 690d25c1d..37c133249 100644 --- a/tests/stringparsingcheck.cpp +++ b/tests/stringparsingcheck.cpp @@ -12,7 +12,12 @@ #define JSON_TEST_STRINGS #endif -#include "dirent_portable.h" +#ifndef _MSC_VER +#include +#else +// Microsoft can't be bothered to provide standard utils. +#include +#endif #include "simdjson.h" char *fullpath; diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index 49f28664b..464d2e528 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -1,4 +1,4 @@ add_library(simdjson-windows-headers INTERFACE) if(MSVC) target_include_directories(simdjson-windows-headers INTERFACE .) -endif() \ No newline at end of file +endif() From ff1d77ead9a651d9e2a1ebeedeb1d83a6c35f56b Mon Sep 17 00:00:00 2001 From: Furkan Usta Date: Sat, 2 May 2020 15:32:43 +0300 Subject: [PATCH 3/4] Add NOMINMAX to parsingchecks --- tests/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f83b80131..5a5a78f8b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -44,8 +44,10 @@ include(${PROJECT_SOURCE_DIR}/tests/add_cpp_test.cmake) # add_cpp_test(numberparsingcheck LABELS acceptance per_implementation) target_link_libraries(numberparsingcheck simdjson-include-source simdjson-windows-headers) +target_compile_definitions(numberparsingcheck PRIVATE NOMINMAX) add_cpp_test(stringparsingcheck LABELS acceptance per_implementation) target_link_libraries(stringparsingcheck simdjson-include-source simdjson-windows-headers) +target_compile_definitions(stringparsingcheck PRIVATE NOMINMAX) # All remaining tests link with simdjson proper link_libraries(simdjson) From 1e9488d4a6d9a7a97cb1abf52cb460c2512f2e4d Mon Sep 17 00:00:00 2001 From: Furkan Usta Date: Sat, 2 May 2020 16:01:30 +0300 Subject: [PATCH 4/4] Remove Microsoft comment regarding dirent in parsingchecks --- tests/numberparsingcheck.cpp | 1 - tests/stringparsingcheck.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/numberparsingcheck.cpp b/tests/numberparsingcheck.cpp index 2dc10214f..92ab25f37 100644 --- a/tests/numberparsingcheck.cpp +++ b/tests/numberparsingcheck.cpp @@ -12,7 +12,6 @@ #ifndef _MSC_VER #include #else -// Microsoft can't be bothered to provide standard utils. #include #endif #include "simdjson.h" diff --git a/tests/stringparsingcheck.cpp b/tests/stringparsingcheck.cpp index 37c133249..eeec5900b 100644 --- a/tests/stringparsingcheck.cpp +++ b/tests/stringparsingcheck.cpp @@ -15,7 +15,6 @@ #ifndef _MSC_VER #include #else -// Microsoft can't be bothered to provide standard utils. #include #endif #include "simdjson.h"