From f6e886f9994b1f513d34ca23cd4214828f0ec799 Mon Sep 17 00:00:00 2001 From: Steffen Schuemann Date: Sat, 29 Aug 2020 20:34:59 +0200 Subject: [PATCH] refs #68, updated readme, fix for failing CI on VS2019. --- README.md | 5 +++-- test/cmake/ParseAndAddCatchTests.cmake | 17 +++++++++++------ test/filesystem_test.cpp | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 11ee172..41f554f 100644 --- a/README.md +++ b/README.md @@ -492,8 +492,9 @@ to the expected behavior. * Pull request [#69](https://github.com/gulrak/filesystem/pull/69), use `wchar_t` versions of `std::fstream` from `ghc::filesystem::fstream` wrappers on Windows if using GCC with libc++. * Bugfix for [#68](https://github.com/gulrak/filesystem/issues/68), better handling of - permission issues for directory iterators when using `fs::directory_options::skip_permission_denied`. - * Bugfix for [#63](https://github.com/gulrak/filesystem/issues/63), fixed issues on Windows + permission issues for directory iterators when using `fs::directory_options::skip_permission_denied` + and initial support for compilation with emscripten. +* Bugfix for [#63](https://github.com/gulrak/filesystem/issues/63), fixed issues on Windows with clang++ and C++17. * Pull request [#62](https://github.com/gulrak/filesystem/pull/62), various fixes for better Android support, thanks for the PR diff --git a/test/cmake/ParseAndAddCatchTests.cmake b/test/cmake/ParseAndAddCatchTests.cmake index 925d932..5e89cb7 100644 --- a/test/cmake/ParseAndAddCatchTests.cmake +++ b/test/cmake/ParseAndAddCatchTests.cmake @@ -144,7 +144,7 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget) if("${TestType}" STREQUAL "SCENARIO") set(Name "Scenario: ${Name}") endif() - if(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME AND TestFixture) + if(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME AND "${TestType}" MATCHES "(CATCH_)?TEST_CASE_METHOD" AND TestFixture ) set(CTestName "${TestFixture}:${Name}") else() set(CTestName "${Name}") @@ -189,24 +189,29 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget) # Escape commas in the test spec string(REPLACE "," "\\," Name ${Name}) + # Work around CMake 3.18.0 change in `add_test()`, before the escaped quotes were neccessary, + # only with CMake 3.18.0 the escaped double quotes confuse the call. This change is reverted in 3.18.1 + if(NOT ${CMAKE_VERSION} VERSION_EQUAL "3.18") + set(CTestName "\"${CTestName}\"") + endif() # Add the test and set its properties - add_test(NAME "\"${CTestName}\"" COMMAND ${OptionalCatchTestLauncher} $ ${Name} ${AdditionalCatchParameters}) + add_test(NAME "${CTestName}" COMMAND ${OptionalCatchTestLauncher} $ ${Name} ${AdditionalCatchParameters}) # Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8") ParseAndAddCatchTests_PrintDebugMessage("Setting DISABLED test property") - set_tests_properties("\"${CTestName}\"" PROPERTIES DISABLED ON) + set_tests_properties("${CTestName}" PROPERTIES DISABLED ON) else() - set_tests_properties("\"${CTestName}\"" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran" + set_tests_properties("${CTestName}" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran" LABELS "${Labels}") endif() set_property( TARGET ${TestTarget} APPEND - PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"") + PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}") set_property( SOURCE ${SourceFile} APPEND - PROPERTY ParseAndAddCatchTests_TESTS "\"${CTestName}\"") + PROPERTY ParseAndAddCatchTests_TESTS "${CTestName}") endif() diff --git a/test/filesystem_test.cpp b/test/filesystem_test.cpp index 88c9e71..0107fde 100644 --- a/test/filesystem_test.cpp +++ b/test/filesystem_test.cpp @@ -2518,7 +2518,7 @@ TEST_CASE("30.10.15.34 space", "[filesystem][operations][fs.op.space]") CHECK(si.free >= si.available); CHECK(!ec); } -#ifdef GHC_OS_WEB // statvfs under emscripten always returns a result, so this tests would fail +#ifndef GHC_OS_WEB // statvfs under emscripten always returns a result, so this tests would fail { std::error_code ec; fs::space_info si;