summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support
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
commit7ecd94cc0bded43bef6833980b901579ab3b440d (patch)
tree6d944ab09038754cac573e1773a1d73648345ab5 /llvm/unittests/Support
parent95e4ac16a5bd7d442b45bc6bc0fd2a994bb5c7a9 (diff)
downloadbcm5719-llvm-7ecd94cc0bded43bef6833980b901579ab3b440d.tar.gz
bcm5719-llvm-7ecd94cc0bded43bef6833980b901579ab3b440d.zip
Support/FileSystem: Add directory_iterator implementation.
llvm-svn: 120989
Diffstat (limited to 'llvm/unittests/Support')
-rw-r--r--llvm/unittests/Support/Path.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp
index 7d94bc31956..76a16a351c8 100644
--- a/llvm/unittests/Support/Path.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud