summaryrefslogtreecommitdiffstats
path: root/unittests/Support/Path.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-06 04:28:42 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-06 04:28:42 +0000
commit753cbbbd3ce28253f381caff83ce2a7f6e08785b (patch)
tree2cd99ba29bce96f8f3db9d4e4ef781c959c68679 /unittests/Support/Path.cpp
parentf150e7695e32d42856d86499fcde970825371637 (diff)
downloadexternal_llvm-753cbbbd3ce28253f381caff83ce2a7f6e08785b.zip
external_llvm-753cbbbd3ce28253f381caff83ce2a7f6e08785b.tar.gz
external_llvm-753cbbbd3ce28253f381caff83ce2a7f6e08785b.tar.bz2
Support/FileSystem: Add directory_iterator implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120989 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support/Path.cpp')
-rw-r--r--unittests/Support/Path.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/unittests/Support/Path.cpp b/unittests/Support/Path.cpp
index 7d94bc3..76a16a3 100644
--- a/unittests/Support/Path.cpp
+++ b/unittests/Support/Path.cpp
@@ -9,6 +9,7 @@
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/PathV2.h"
+#include "llvm/Support/ErrorHandling.h"
#include "gtest/gtest.h"
@@ -168,6 +169,18 @@ TEST(Support, Path) {
// Make sure Temp1 doesn't exist.
ASSERT_FALSE(fs::exists(Twine(TempPath), TempFileExists));
EXPECT_FALSE(TempFileExists);
+
+ // I've yet to do directory iteration on Unix.
+#ifdef LLVM_ON_WIN32
+ error_code ec;
+ for (fs::directory_iterator i(".", ec), e; i != e; i.increment(ec)) {
+ if (ec) {
+ errs() << ec.message() << '\n';
+ errs().flush();
+ report_fatal_error("Directory iteration failed!");
+ }
+ }
+#endif
}
} // anonymous namespace