diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2020-03-17 13:40:25 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2020-03-17 13:40:25 +0300 |
commit | 154876409ea7a87e2c4af08418954f8d884c67fe (patch) | |
tree | d32f7e752f076f86988e710e25f115082a2079d2 /test | |
parent | cbd573161b6703febcdc4f26d701066430317d27 (diff) |
Workaround path_view test failures on libstdc++.
Mandate at least C++ 17 on Mac OS, in order to find <filesystem>.
Diffstat (limited to 'test')
-rw-r--r-- | test/tests/path_view.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/test/tests/path_view.cpp b/test/tests/path_view.cpp index 81f1b5ce..a0488b5e 100644 --- a/test/tests/path_view.cpp +++ b/test/tests/path_view.cpp @@ -30,7 +30,15 @@ template <class U> inline void CheckPathView(const LLFIO_V2_NAMESPACE::filesyste using LLFIO_V2_NAMESPACE::filesystem::path; auto r1 = c(p); auto r2 = c(path_view(p)); - BOOST_CHECK(r1 == r2); + if(r2.empty() && r1.native().size() == 1 && r1.native()[0] == '.') + { + // libstdc++ returns "." as the tail component for /a/b/ type paths + BOOST_CHECK(true); + } + else + { + BOOST_CHECK(r1 == r2); + } // if(r1 != r2) { std::cerr << "For " << desc << " with path " << p << "\n"; @@ -60,14 +68,30 @@ static inline void CheckPathIteration(const LLFIO_V2_NAMESPACE::filesystem::path for(; it1 != test1.end() && it2 != test2.end(); ++it1, ++it2) { std::cout << " " << *it1 << " == " << *it2 << "?" << std::endl; - BOOST_CHECK(*it1 == it2->path()); + if(it2->empty() && it1->native().size() == 1 && it1->native()[0] == '.') + { + // libstdc++ returns "." as the tail component for /a/b/ type paths + BOOST_CHECK(true); + } + else + { + BOOST_CHECK(*it1 == it2->path()); + } } BOOST_CHECK(it1 == test1.end()); BOOST_CHECK(it2 == test2.end()); for(--it1, --it2; it1 != test1.begin() && it2 != test2.begin(); --it1, --it2) { std::cout << " " << *it1 << " == " << *it2 << "?" << std::endl; - BOOST_CHECK(*it1 == it2->path()); + if(it2->empty() && it1->native().size() == 1 && it1->native()[0] == '.') + { + // libstdc++ returns "." as the tail component for /a/b/ type paths + BOOST_CHECK(true); + } + else + { + BOOST_CHECK(*it1 == it2->path()); + } } BOOST_CHECK(it1 == test1.begin()); BOOST_CHECK(it2 == test2.begin()); |