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. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328475 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -18,11 +18,10 @@
|
||||
// directory_entry(directory_entry&&) noexcept = default;
|
||||
// explicit directory_entry(const path);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
void test_default_ctor()
|
||||
{
|
||||
|
||||
@@ -18,11 +18,10 @@
|
||||
// void assign(path const&);
|
||||
// void replace_filename(path const&);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
void test_copy_assign_operator()
|
||||
{
|
||||
|
||||
@@ -21,11 +21,10 @@
|
||||
// bool operator>=(directory_entry const&) const noexcept;
|
||||
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
#define CHECK_OP(Op) \
|
||||
static_assert(std::is_same<decltype(ce. operator Op (ce)), bool>::value, ""); \
|
||||
|
||||
@@ -16,11 +16,10 @@
|
||||
// const path& path() const noexcept;
|
||||
// operator const path&() const noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
void test_path_method() {
|
||||
using namespace fs;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// file_status status() const;
|
||||
// file_status status(error_code const&) const noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// file_status symlink_status() const;
|
||||
// file_status symlink_status(error_code&) const noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// directory_iterator(directory_iterator const&);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(directory_iterator_copy_construct_tests)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// directory_iterator& operator=(directory_iterator const&);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(directory_iterator_copy_assign_tests)
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// directory_iterator(const path& p, error_code& ec);
|
||||
// directory_iterator(const path& p, directory_options options, error_code& ec);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(directory_iterator_constructor_tests)
|
||||
|
||||
@@ -86,7 +86,7 @@ TEST_CASE(test_construction_from_bad_path)
|
||||
|
||||
TEST_CASE(access_denied_test_case)
|
||||
{
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
scoped_test_env env;
|
||||
path const testDir = env.make_env_path("dir1");
|
||||
path const testFile = testDir / "testFile";
|
||||
@@ -122,7 +122,7 @@ TEST_CASE(access_denied_test_case)
|
||||
|
||||
TEST_CASE(access_denied_to_file_test_case)
|
||||
{
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
scoped_test_env env;
|
||||
path const testFile = env.make_env_path("file1");
|
||||
env.create_file(testFile, 42);
|
||||
|
||||
@@ -16,13 +16,12 @@
|
||||
// directory_iterator::directory_iterator() noexcept
|
||||
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main() {
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// directory_iterator& operator++();
|
||||
// directory_iterator& increment(error_code& ec);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "filesystem_test_helper.hpp"
|
||||
#include <iostream>
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(directory_iterator_increment_tests)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// directory_iterator(directory_iterator&&) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(directory_iterator_move_construct_tests)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// directory_iterator& operator=(directory_iterator const&);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -30,7 +30,7 @@
|
||||
#pragma clang diagnostic ignored "-Wself-move"
|
||||
#endif
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(directory_iterator_move_assign_tests)
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// directory_iterator begin(directory_iterator iter) noexcept;
|
||||
// directory_iterator end(directory_iterator iter) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "filesystem_test_helper.hpp"
|
||||
#include <iostream>
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(directory_iterator_begin_end_tests)
|
||||
|
||||
|
||||
@@ -19,13 +19,12 @@
|
||||
// typedef ... reference;
|
||||
// typedef ... iterator_category
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main() {
|
||||
using namespace fs;
|
||||
|
||||
@@ -16,13 +16,12 @@
|
||||
// explicit file_status() noexcept;
|
||||
// explicit file_status(file_type, perms prms = perms::unknown) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_convertible.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main() {
|
||||
using namespace fs;
|
||||
|
||||
@@ -16,11 +16,10 @@
|
||||
// void type(file_type) noexcept;
|
||||
// void permissions(perms) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main() {
|
||||
using namespace fs;
|
||||
|
||||
@@ -16,11 +16,10 @@
|
||||
// file_type type() const noexcept;
|
||||
// perms permissions(p) const noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main() {
|
||||
using namespace fs;
|
||||
|
||||
@@ -21,13 +21,12 @@
|
||||
// const path& path1() const noexcept;
|
||||
// const path& path2() const noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
void test_constructors() {
|
||||
using namespace fs;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
// path(InputIterator first, InputIterator last);
|
||||
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <iterator>
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "test_macros.h"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
|
||||
template <class It>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
// path& append(InputIterator first, InputIterator last);
|
||||
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <string_view>
|
||||
#include <cassert>
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "count_new.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
struct AppendOperatorTestcase {
|
||||
MultiStringType lhs;
|
||||
|
||||
@@ -15,14 +15,13 @@
|
||||
|
||||
// path& operator=(path const&);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "count_new.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main() {
|
||||
using namespace fs;
|
||||
|
||||
@@ -15,13 +15,12 @@
|
||||
|
||||
// path& operator=(path const&);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main() {
|
||||
using namespace fs;
|
||||
|
||||
@@ -15,14 +15,13 @@
|
||||
|
||||
// path& operator=(path&&) noexcept
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "count_new.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main() {
|
||||
using namespace fs;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
// path& assign(InputIterator first, InputIterator last);
|
||||
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <string_view>
|
||||
#include <cassert>
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "filesystem_test_helper.hpp"
|
||||
#include <iostream>
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
template <class CharT>
|
||||
void RunTestCase(MultiStringType const& MS) {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
//
|
||||
// size_t hash_value(path const&) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
#include <cassert>
|
||||
@@ -36,7 +36,6 @@
|
||||
#include "count_new.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
struct PathCompareTest {
|
||||
const char* LHS;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
// path& concat(InputIterator first, InputIterator last);
|
||||
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
@@ -39,7 +39,6 @@
|
||||
#include "count_new.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
struct ConcatOperatorTestcase {
|
||||
MultiStringType lhs;
|
||||
|
||||
@@ -15,13 +15,12 @@
|
||||
|
||||
// path(path const&)
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main() {
|
||||
using namespace fs;
|
||||
|
||||
@@ -15,13 +15,12 @@
|
||||
|
||||
// path() noexcept
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main() {
|
||||
using namespace fs;
|
||||
|
||||
@@ -15,14 +15,13 @@
|
||||
|
||||
// path(path&&) noexcept
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "count_new.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main() {
|
||||
using namespace fs;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
// path(InputIterator first, InputIterator last);
|
||||
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "min_allocator.h"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
template <class CharT>
|
||||
void RunTestCase(MultiStringType const& MS) {
|
||||
|
||||
@@ -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}}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// basic_string<ECharT, Traits, Allocator>
|
||||
// generic_string(const Allocator& a = Allocator()) const;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "min_allocator.h"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
MultiStringType longString = MKSTR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/123456789/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
// std::u32string generic_u32string() const;
|
||||
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "min_allocator.h"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
MultiStringType longString = MKSTR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/123456789/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// void clear() noexcept
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "count_new.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main() {
|
||||
using namespace fs;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// path& make_preferred()
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "count_new.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
struct MakePreferredTestcase {
|
||||
const char* value;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// path& remove_filename()
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "count_new.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
struct RemoveFilenameTestcase {
|
||||
const char* value;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// path& replace_extension(path const& p = path())
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "count_new.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
struct ReplaceExtensionTestcase {
|
||||
const char* value;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// path& replace_filename()
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "count_new.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
struct ReplaceFilenameTestcase {
|
||||
const char* value;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// void swap(path& rhs) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "count_new.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
struct SwapTestcase {
|
||||
const char* value1;
|
||||
|
||||
@@ -16,14 +16,13 @@
|
||||
|
||||
// const value_type* c_str() const noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
// std::u32string u32string() const;
|
||||
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "min_allocator.h"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
MultiStringType longString = MKSTR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/123456789/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
|
||||
|
||||
@@ -15,14 +15,13 @@
|
||||
|
||||
// const string_type& native() const noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -16,14 +16,13 @@
|
||||
|
||||
// operator string_type() const;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// basic_string<ECharT, Traits, Allocator>
|
||||
// string(const Allocator& a = Allocator()) const;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "min_allocator.h"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
// the SSO is always triggered for strings of size 2.
|
||||
MultiStringType shortString = MKSTR("a");
|
||||
|
||||
@@ -13,14 +13,13 @@
|
||||
|
||||
// path operator/(path const&, path const&);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
// This is mainly tested via the member append functions.
|
||||
int main()
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// template <class InputIter>
|
||||
// path u8path(InputIter, InputIter);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "count_new.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
// operator>>(basic_istream<charT, traits>& is, path& p)
|
||||
//
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <sstream>
|
||||
#include <cassert>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
// passes.
|
||||
// XFAIL: *
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <sstream>
|
||||
#include <cassert>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
// void swap(path& lhs, path& rhs) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "count_new.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
// NOTE: this is tested in path.members/path.modifiers via the member swap.
|
||||
int main()
|
||||
|
||||
@@ -17,13 +17,12 @@
|
||||
// typedef basic_string<value_type> string_type;
|
||||
// static constexpr value_type preferred_separator = ...;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
int main() {
|
||||
using namespace fs;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// recursive_recursive_directory_iterator(recursive_recursive_directory_iterator const&);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(recursive_directory_iterator_copy_construct_tests)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// recursive_directory_iterator& operator=(recursive_directory_iterator const&);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(recursive_directory_iterator_copy_assign_tests)
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
// recursive_directory_iterator(const path& p, directory_options options, error_code& ec);
|
||||
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
using RDI = recursive_directory_iterator;
|
||||
|
||||
@@ -87,7 +87,7 @@ TEST_CASE(test_construction_from_bad_path)
|
||||
|
||||
TEST_CASE(access_denied_test_case)
|
||||
{
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
scoped_test_env env;
|
||||
path const testDir = env.make_env_path("dir1");
|
||||
path const testFile = testDir / "testFile";
|
||||
@@ -124,7 +124,7 @@ TEST_CASE(access_denied_test_case)
|
||||
|
||||
TEST_CASE(access_denied_to_file_test_case)
|
||||
{
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
scoped_test_env env;
|
||||
path const testFile = env.make_env_path("file1");
|
||||
env.create_file(testFile, 42);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// int depth() const
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(recursive_directory_iterator_depth_tests)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// void disable_recursion_pending();
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(recursive_directory_iterator_disable_recursion_pending_tests)
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// recursive_directory_iterator& operator++();
|
||||
// recursive_directory_iterator& increment(error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(recursive_directory_iterator_increment_tests)
|
||||
|
||||
@@ -140,7 +140,7 @@ TEST_CASE(test_follow_symlinks)
|
||||
|
||||
TEST_CASE(access_denied_on_recursion_test_case)
|
||||
{
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
scoped_test_env env;
|
||||
const path testFiles[] = {
|
||||
env.create_dir("dir1"),
|
||||
@@ -239,7 +239,7 @@ TEST_CASE(access_denied_on_recursion_test_case)
|
||||
// See llvm.org/PR35078
|
||||
TEST_CASE(test_PR35078)
|
||||
{
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
scoped_test_env env;
|
||||
const path testFiles[] = {
|
||||
env.create_dir("dir1"),
|
||||
@@ -309,7 +309,7 @@ TEST_CASE(test_PR35078)
|
||||
// See llvm.org/PR35078
|
||||
TEST_CASE(test_PR35078_with_symlink)
|
||||
{
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
scoped_test_env env;
|
||||
const path testFiles[] = {
|
||||
env.create_dir("dir1"),
|
||||
@@ -393,7 +393,7 @@ TEST_CASE(test_PR35078_with_symlink)
|
||||
// See llvm.org/PR35078
|
||||
TEST_CASE(test_PR35078_with_symlink_file)
|
||||
{
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
scoped_test_env env;
|
||||
const path testFiles[] = {
|
||||
env.create_dir("dir1"),
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// recursive_directory_iterator(recursive_directory_iterator&&) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(recursive_directory_iterator_move_construct_tests)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// recursive_directory_iterator& operator=(recursive_directory_iterator const&);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -30,7 +30,7 @@
|
||||
#pragma clang diagnostic ignored "-Wself-move"
|
||||
#endif
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(recursive_directory_iterator_move_assign_tests)
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// void pop();
|
||||
// void pop(error_code& ec);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(recursive_directory_iterator_pop_tests)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// bool recursion_pending() const;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(recursive_directory_iterator_recursion_pending_tests)
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept;
|
||||
// recursive_directory_iterator end(recursive_directory_iterator iter) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <set>
|
||||
#include <cassert>
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "filesystem_test_helper.hpp"
|
||||
#include <iostream>
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(recursive_directory_iterator_begin_end_tests)
|
||||
|
||||
|
||||
@@ -13,14 +13,13 @@
|
||||
|
||||
// enum class copy_options;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "check_bitmask_types.hpp"
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
constexpr fs::copy_options ME(int val) { return static_cast<fs::copy_options>(val); }
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
// enum class directory_options;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
#include <sys/stat.h>
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "test_macros.h"
|
||||
#include "check_bitmask_types.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
constexpr fs::directory_options ME(int val) { return static_cast<fs::directory_options>(val); }
|
||||
|
||||
|
||||
@@ -13,13 +13,12 @@
|
||||
|
||||
// enum class file_type;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
constexpr fs::file_type ME(int val) { return static_cast<fs::file_type>(val); }
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
// enum class perms;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
#include <sys/stat.h>
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "test_macros.h"
|
||||
#include "check_bitmask_types.hpp"
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
constexpr fs::perms ME(int val) { return static_cast<fs::perms>(val); }
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
// typedef TrivialClock file_time_type;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <chrono>
|
||||
#include <type_traits>
|
||||
|
||||
@@ -25,7 +25,7 @@ typedef std::chrono::time_point<ExpectedClock> ExpectedTimePoint;
|
||||
|
||||
int main() {
|
||||
static_assert(std::is_same<
|
||||
std::experimental::filesystem::file_time_type,
|
||||
fs::file_time_type,
|
||||
ExpectedTimePoint
|
||||
>::value, "");
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
// path absolute(const path& p, const path& base=current_path());
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(filesystem_absolute_path_test_suite)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// path canonical(const path& p, error_code& ec);
|
||||
// path canonical(const path& p, const path& base, error_code& ec);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(filesystem_canonical_path_test_suite)
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
// void copy(const path& from, const path& to, copy_options options,
|
||||
// error_code& ec);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cstddef>
|
||||
#include <cassert>
|
||||
@@ -26,8 +26,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
namespace fs = std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
using CO = fs::copy_options;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
// bool copy_file(const path& from, const path& to, copy_options options,
|
||||
// error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <chrono>
|
||||
#include <cassert>
|
||||
@@ -26,8 +26,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
namespace fs = std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
using CO = fs::copy_options;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// void copy_symlink(const path& existing_symlink, const path& new_symlink,
|
||||
// error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
namespace fs = std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(filesystem_copy_symlink_test_suite)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// bool create_directories(const path& p);
|
||||
// bool create_directories(const path& p, error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
namespace fs = std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(filesystem_create_directories_test_suite)
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// bool create_directory(const path& p, const path& attr);
|
||||
// bool create_directory(const path& p, const path& attr, error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
namespace fs = std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
fs::perms read_umask() {
|
||||
mode_t old_mask = umask(0);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// bool create_directory(const path& p, const path& attr);
|
||||
// bool create_directory(const path& p, const path& attr, error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
namespace fs = std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(filesystem_create_directory_test_suite)
|
||||
|
||||
|
||||
@@ -15,15 +15,14 @@
|
||||
// void create_directory_symlink(const path& existing_symlink, const path& new_symlink,
|
||||
// error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
namespace fs = std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(filesystem_create_directory_symlink_test_suite)
|
||||
|
||||
|
||||
@@ -15,14 +15,13 @@
|
||||
// void create_hard_link(const path& existing_symlink, const path& new_symlink,
|
||||
// error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
namespace fs = std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(filesystem_create_hard_link_test_suite)
|
||||
|
||||
|
||||
@@ -15,15 +15,14 @@
|
||||
// void create_symlink(const path& existing_symlink, const path& new_symlink,
|
||||
// error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
namespace fs = std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(filesystem_create_symlink_test_suite)
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// void current_path(path const&);
|
||||
// void current_path(path const&, std::error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(filesystem_current_path_path_test_suite)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// bool equivalent(path const& lhs, path const& rhs);
|
||||
// bool equivalent(path const& lhs, path const& rhs, std::error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(equivalent_test_suite)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// bool exists(path const& p);
|
||||
// bool exists(path const& p, std::error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(exists_test_suite)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// uintmax_t file_size(const path& p);
|
||||
// uintmax_t file_size(const path& p, std::error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(file_size_test_suite)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// uintmax_t hard_link_count(const path& p);
|
||||
// uintmax_t hard_link_count(const path& p, std::error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(hard_link_count_test_suite)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// bool is_block_file(path const& p);
|
||||
// bool is_block_file(path const& p, std::error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(is_block_file_test_suite)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// bool is_character_file(path const& p);
|
||||
// bool is_character_file(path const& p, std::error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(is_character_file_test_suite)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// bool is_directory(path const& p);
|
||||
// bool is_directory(path const& p, std::error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(is_directory_test_suite)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// bool is_empty(path const& p);
|
||||
// bool is_empty(path const& p, std::error_code& ec);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(is_empty_test_suite)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// bool is_fifo(path const& p);
|
||||
// bool is_fifo(path const& p, std::error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(is_fifo_test_suite)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// bool is_other(path const& p);
|
||||
// bool is_other(path const& p, std::error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(is_other_test_suite)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// bool is_regular_file(path const& p);
|
||||
// bool is_regular_file(path const& p, std::error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(is_regular_file_test_suite)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// bool is_socket(path const& p);
|
||||
// bool is_socket(path const& p, std::error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(is_socket_test_suite)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// bool is_symlink(path const& p);
|
||||
// bool is_symlink(path const& p, std::error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(is_symlink_test_suite)
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// std::error_code& ec) noexcept;
|
||||
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
#include <type_traits>
|
||||
#include <chrono>
|
||||
#include <fstream>
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
|
||||
std::pair<std::time_t, std::time_t> GetTimes(path const& p) {
|
||||
|
||||
@@ -15,14 +15,13 @@
|
||||
// void permissions(const path& p, perms prms, std::error_code& ec) noexcept;
|
||||
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
namespace fs = std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
using PR = fs::perms;
|
||||
|
||||
|
||||
@@ -14,14 +14,13 @@
|
||||
// path read_symlink(const path& p);
|
||||
// path read_symlink(const path& p, error_code& ec);
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
namespace fs = std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(filesystem_read_symlink_test_suite)
|
||||
|
||||
|
||||
@@ -14,14 +14,13 @@
|
||||
// bool remove(const path& p);
|
||||
// bool remove(const path& p, error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
namespace fs = std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(filesystem_remove_test_suite)
|
||||
|
||||
|
||||
@@ -14,14 +14,13 @@
|
||||
// uintmax_t remove_all(const path& p);
|
||||
// uintmax_t remove_all(const path& p, error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
namespace fs = std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(filesystem_remove_all_test_suite)
|
||||
|
||||
|
||||
@@ -14,14 +14,13 @@
|
||||
// void rename(const path& old_p, const path& new_p);
|
||||
// void rename(const path& old_p, const path& new_p, error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
namespace fs = std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(filesystem_rename_test_suite)
|
||||
|
||||
|
||||
@@ -14,14 +14,13 @@
|
||||
// void resize_file(const path& p, uintmax_t new_size);
|
||||
// void resize_file(const path& p, uintmax_t new_size, error_code& ec) noexcept;
|
||||
|
||||
#include <experimental/filesystem>
|
||||
#include "filesystem_include.hpp"
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "rapid-cxx-test.hpp"
|
||||
#include "filesystem_test_helper.hpp"
|
||||
|
||||
using namespace std::experimental::filesystem;
|
||||
namespace fs = std::experimental::filesystem;
|
||||
using namespace fs;
|
||||
|
||||
TEST_SUITE(filesystem_resize_file_test_suite)
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user