summaryrefslogtreecommitdiffstats
path: root/unittests/Support/Path.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-01-05 16:39:46 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-01-05 16:39:46 +0000
commitf94f7325ad28f804eb87463821b0a89f7bf08612 (patch)
tree1108c40cc555cad1f503341b7c4ff1714b8a7847 /unittests/Support/Path.cpp
parent7fd682aaf2ceeb953da190a2add326963ff45c3e (diff)
downloadexternal_llvm-f94f7325ad28f804eb87463821b0a89f7bf08612.zip
external_llvm-f94f7325ad28f804eb87463821b0a89f7bf08612.tar.gz
external_llvm-f94f7325ad28f804eb87463821b0a89f7bf08612.tar.bz2
UnitTests/Path: Fix typo, add error number, and enable the directory cleanup code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122885 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support/Path.cpp')
-rw-r--r--unittests/Support/Path.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/unittests/Support/Path.cpp b/unittests/Support/Path.cpp
index 132d439..bc39a22 100644
--- a/unittests/Support/Path.cpp
+++ b/unittests/Support/Path.cpp
@@ -19,9 +19,10 @@ using namespace llvm::sys;
#define ASSERT_NO_ERROR(x) \
if (error_code ec = x) { \
SmallString<128> Message; \
- GTEST_FATAL_FAILURE_((Twine(#x) + ": did not return errc::success.\n" + \
+ GTEST_FATAL_FAILURE_((Twine(#x ": did not return errc::success.\n") + \
+ "error number: " + Twine(ec.value()) + "\n" + \
"error message: " + \
- x.message()).toNullTerminatedStringRef(Message).data()); \
+ ec.message()).toNullTerminatedStringRef(Message).data()); \
} else {}
namespace {
@@ -132,16 +133,20 @@ protected:
SmallString<128> TestDirectory;
virtual void SetUp() {
- /*int fd;
+ int fd;
ASSERT_NO_ERROR(
- fs::unique_file("%%-%%-%%-%%/test-directory.anchor", fd, TestDirectory));
+ fs::unique_file("file-system-test-%%-%%-%%-%%/test-directory.anchor", fd,
+ TestDirectory));
// We don't care about this specific file.
- ::close(fd);*/
+ ::close(fd);
+ TestDirectory = path::parent_path(TestDirectory);
+ errs() << "Test Directory: " << TestDirectory << '\n';
+ errs().flush();
}
virtual void TearDown() {
- /*uint32_t removed;
- ASSERT_NO_ERROR(fs::remove_all(TestDirectory.str(), removed));*/
+ uint32_t removed;
+ ASSERT_NO_ERROR(fs::remove_all(TestDirectory.str(), removed));
}
};