mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 02:33:33 +00:00
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
This commit is contained in:
parent
7fd682aaf2
commit
f94f7325ad
@ -19,9 +19,10 @@ using namespace llvm::sys;
|
|||||||
#define ASSERT_NO_ERROR(x) \
|
#define ASSERT_NO_ERROR(x) \
|
||||||
if (error_code ec = x) { \
|
if (error_code ec = x) { \
|
||||||
SmallString<128> Message; \
|
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: " + \
|
"error message: " + \
|
||||||
x.message()).toNullTerminatedStringRef(Message).data()); \
|
ec.message()).toNullTerminatedStringRef(Message).data()); \
|
||||||
} else {}
|
} else {}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -132,16 +133,20 @@ protected:
|
|||||||
SmallString<128> TestDirectory;
|
SmallString<128> TestDirectory;
|
||||||
|
|
||||||
virtual void SetUp() {
|
virtual void SetUp() {
|
||||||
/*int fd;
|
int fd;
|
||||||
ASSERT_NO_ERROR(
|
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.
|
// 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() {
|
virtual void TearDown() {
|
||||||
/*uint32_t removed;
|
uint32_t removed;
|
||||||
ASSERT_NO_ERROR(fs::remove_all(TestDirectory.str(), removed));*/
|
ASSERT_NO_ERROR(fs::remove_all(TestDirectory.str(), removed));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user