teak-llvm/libcxx/test/support/filesystem_include.hpp
Eric Fiselier 19aae8fe2f 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
2018-03-26 05:46:57 +00:00

19 lines
427 B
C++

#ifndef TEST_SUPPORT_FILESYSTEM_INCLUDE_HPP
#define TEST_SUPPORT_FILESYSTEM_INCLUDE_HPP
#include <ciso646>
// Test against std::filesystem for STL's other than libc++
#ifndef _LIBCPP_VERSION
#define TEST_INCLUDE_STD_FILESYSTEM
#endif
#ifdef TEST_INCLUDE_STD_FILESYSTEM
#include <filesystem>
namespace fs = std::filesystem;
#else
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#endif
#endif