summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2019-03-19 19:09:33 +0000
committerLouis Dionne <ldionne@apple.com>2019-03-19 19:09:33 +0000
commit72122d058b170eafc643ec659a9298b3b103cdfd (patch)
tree5375a5ed86a44a060638330aa825b1a5bc3c4b23 /libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp
parentc2e35a6f3258d102b731c77de9530714c4d02802 (diff)
downloadbcm5719-llvm-72122d058b170eafc643ec659a9298b3b103cdfd.tar.gz
bcm5719-llvm-72122d058b170eafc643ec659a9298b3b103cdfd.zip
[libc++] Build <filesystem> support as part of the dylib
Summary: This patch treats <filesystem> as a first-class citizen of the dylib, like all other sub-libraries (e.g. <chrono>). As such, it also removes all special handling for installing the filesystem library separately or disabling part of the test suite from the lit command line. Reviewers: mclow.lists, EricWF, serge-sans-paille Subscribers: mgorny, christof, jkorous, dexonsmith, jfb, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D59152 llvm-svn: 356500
Diffstat (limited to 'libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp')
-rw-r--r--libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp157
1 files changed, 0 insertions, 157 deletions
diff --git a/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp b/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp
deleted file mode 100644
index de97832c4fa..00000000000
--- a/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/copy_assign.pass.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <filesystem>
-
-// class recursive_directory_iterator
-
-// recursive_directory_iterator& operator=(recursive_directory_iterator const&);
-
-#include "filesystem_include.hpp"
-#include <type_traits>
-#include <set>
-#include <cassert>
-
-#include "test_macros.h"
-#include "rapid-cxx-test.hpp"
-#include "filesystem_test_helper.hpp"
-
-using namespace fs;
-
-TEST_SUITE(recursive_directory_iterator_copy_assign_tests)
-
-recursive_directory_iterator createInterestingIterator()
- // Create an "interesting" iterator where all fields are
- // in a non-default state. The returned 'it' is in a
- // state such that:
- // it.options() == directory_options::skip_permission_denied
- // it.depth() == 1
- // it.recursion_pending() == true
-{
- const path testDir = StaticEnv::Dir;
- const recursive_directory_iterator endIt;
- recursive_directory_iterator it(testDir,
- directory_options::skip_permission_denied);
- TEST_ASSERT(it != endIt);
- while (it.depth() != 1) {
- ++it;
- TEST_ASSERT(it != endIt);
- }
- TEST_ASSERT(it.depth() == 1);
- it.disable_recursion_pending();
- return it;
-}
-
-
-recursive_directory_iterator createDifferentInterestingIterator()
- // Create an "interesting" iterator where all fields are
- // in a non-default state. The returned 'it' is in a
- // state such that:
- // it.options() == directory_options::follow_directory_symlink
- // it.depth() == 2
- // it.recursion_pending() == false
-{
- const path testDir = StaticEnv::Dir;
- const recursive_directory_iterator endIt;
- recursive_directory_iterator it(testDir,
- directory_options::follow_directory_symlink);
- TEST_ASSERT(it != endIt);
- while (it.depth() != 2) {
- ++it;
- TEST_ASSERT(it != endIt);
- }
- TEST_ASSERT(it.depth() == 2);
- return it;
-}
-
-TEST_CASE(test_assignment_signature) {
- using D = recursive_directory_iterator;
- static_assert(std::is_copy_assignable<D>::value, "");
-}
-
-TEST_CASE(test_copy_to_end_iterator)
-{
- const recursive_directory_iterator endIt;
-
- const recursive_directory_iterator from = createInterestingIterator();
- const path entry = *from;
-
- recursive_directory_iterator to;
- to = from;
- TEST_REQUIRE(to == from);
- TEST_CHECK(*to == entry);
- TEST_CHECK(to.options() == from.options());
- TEST_CHECK(to.depth() == from.depth());
- TEST_CHECK(to.recursion_pending() == from.recursion_pending());
-}
-
-
-TEST_CASE(test_copy_from_end_iterator)
-{
- const recursive_directory_iterator from;
- recursive_directory_iterator to = createInterestingIterator();
-
- to = from;
- TEST_REQUIRE(to == from);
- TEST_CHECK(to == recursive_directory_iterator{});
-}
-
-TEST_CASE(test_copy_valid_iterator)
-{
- const recursive_directory_iterator endIt;
-
- const recursive_directory_iterator it = createInterestingIterator();
- const path entry = *it;
-
- recursive_directory_iterator it2 = createDifferentInterestingIterator();
- TEST_REQUIRE(it2 != it);
- TEST_CHECK(it2.options() != it.options());
- TEST_CHECK(it2.depth() != it.depth());
- TEST_CHECK(it2.recursion_pending() != it.recursion_pending());
- TEST_CHECK(*it2 != entry);
-
- it2 = it;
- TEST_REQUIRE(it2 == it);
- TEST_CHECK(it2.options() == it.options());
- TEST_CHECK(it2.depth() == it.depth());
- TEST_CHECK(it2.recursion_pending() == it.recursion_pending());
- TEST_CHECK(*it2 == entry);
-}
-
-TEST_CASE(test_returns_reference_to_self)
-{
- const recursive_directory_iterator it;
- recursive_directory_iterator it2;
- recursive_directory_iterator& ref = (it2 = it);
- TEST_CHECK(&ref == &it2);
-}
-
-TEST_CASE(test_self_copy)
-{
- // Create two non-equal iterators that have exactly the same state.
- recursive_directory_iterator it = createInterestingIterator();
- recursive_directory_iterator it2 = createInterestingIterator();
- TEST_CHECK(it != it2);
- TEST_CHECK(it2.options() == it.options());
- TEST_CHECK(it2.depth() == it.depth());
- TEST_CHECK(it2.recursion_pending() == it.recursion_pending());
- TEST_CHECK(*it2 == *it);
-
- // perform a self-copy and check that the state still matches the
- // other unmodified iterator.
- recursive_directory_iterator const& cit = it;
- it = cit;
- TEST_CHECK(it2.options() == it.options());
- TEST_CHECK(it2.depth() == it.depth());
- TEST_CHECK(it2.recursion_pending() == it.recursion_pending());
- TEST_CHECK(*it2 == *it);
-}
-
-TEST_SUITE_END()
OpenPOWER on IntegriCloud