summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/experimental/filesystem/class.path/path.member/path.decompose
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2018-03-26 05:46:57 +0000
committerEric Fiselier <eric@efcs.ca>2018-03-26 05:46:57 +0000
commit19aae8fe2f2a5dfaaa7b6f2631f3f86801fc832d (patch)
treea27358ca3b9ff71131d520763aa4cf86cb934efb /libcxx/test/std/experimental/filesystem/class.path/path.member/path.decompose
parent6f28d3c954e31c48d6c67950acc24380d92ea843 (diff)
downloadbcm5719-llvm-19aae8fe2f2a5dfaaa7b6f2631f3f86801fc832d.tar.gz
bcm5719-llvm-19aae8fe2f2a5dfaaa7b6f2631f3f86801fc832d.zip
Make filesystem tests generic between experimental and std versions.
As I move towards implementing std::filesystem, there is a need to make the existing tests run against both the std and experimental versions. Additionally, it's helpful to allow running the tests against other implementations of filesystem. This patch converts the test to easily target either. First, it adds a filesystem_include.hpp header which is soley responsible for selecting and including the correct implementation. Second, it converts existing tests to use this header instead of including filesystem directly. llvm-svn: 328475
Diffstat (limited to 'libcxx/test/std/experimental/filesystem/class.path/path.member/path.decompose')
-rw-r--r--libcxx/test/std/experimental/filesystem/class.path/path.member/path.decompose/empty.fail.cpp5
-rw-r--r--libcxx/test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp3
2 files changed, 3 insertions, 5 deletions
diff --git a/libcxx/test/std/experimental/filesystem/class.path/path.member/path.decompose/empty.fail.cpp b/libcxx/test/std/experimental/filesystem/class.path/path.member/path.decompose/empty.fail.cpp
index 7e1fea7d34d..377b94e52c7 100644
--- a/libcxx/test/std/experimental/filesystem/class.path/path.member/path.decompose/empty.fail.cpp
+++ b/libcxx/test/std/experimental/filesystem/class.path/path.member/path.decompose/empty.fail.cpp
@@ -17,12 +17,11 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
-#include <experimental/filesystem>
-
+#include "filesystem_include.hpp"
#include "test_macros.h"
int main ()
{
- std::experimental::filesystem::path c;
+ fs::path c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
}
diff --git a/libcxx/test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp b/libcxx/test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp
index 267d4932c31..6dd24b51156 100644
--- a/libcxx/test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp
+++ b/libcxx/test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp
@@ -44,7 +44,7 @@
// iterator end() const;
-#include <experimental/filesystem>
+#include "filesystem_include.hpp"
#include <type_traits>
#include <vector>
#include <cassert>
@@ -54,7 +54,6 @@
#include "count_new.hpp"
#include "filesystem_test_helper.hpp"
-namespace fs = std::experimental::filesystem;
struct PathDecomposeTestcase
{
std::string raw;
OpenPOWER on IntegriCloud