summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/FileOutputBufferTest.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-27 03:45:31 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-27 03:45:31 +0000
commit7ffacc4992129a8a8f2c6986c6bdc92802da91f9 (patch)
tree7f4e5676140f4c2ee0ab3ae24b20ab26f3668037 /llvm/unittests/Support/FileOutputBufferTest.cpp
parent70bb43a11579615ec3707f293018efc94841d552 (diff)
downloadbcm5719-llvm-7ffacc4992129a8a8f2c6986c6bdc92802da91f9.tar.gz
bcm5719-llvm-7ffacc4992129a8a8f2c6986c6bdc92802da91f9.zip
Add a convenience createUniqueDirectory function.
There are a few valid situation where we care about the structure inside a directory, but not about the directory itself. A simple example is for unit testing directory traversal. PathV1 had a function like this, add one to V2 and port existing users of the created temp file and delete it hack to using it. llvm-svn: 185059
Diffstat (limited to 'llvm/unittests/Support/FileOutputBufferTest.cpp')
-rw-r--r--llvm/unittests/Support/FileOutputBufferTest.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/unittests/Support/FileOutputBufferTest.cpp b/llvm/unittests/Support/FileOutputBufferTest.cpp
index c7ca1ab6a61..5e873193f28 100644
--- a/llvm/unittests/Support/FileOutputBufferTest.cpp
+++ b/llvm/unittests/Support/FileOutputBufferTest.cpp
@@ -30,12 +30,8 @@ TEST(FileOutputBuffer, Test) {
// Create unique temporary directory for these tests
SmallString<128> TestDirectory;
{
- int fd;
ASSERT_NO_ERROR(
- fs::unique_file("FileOutputBuffer-test-%%-%%-%%-%%/dir", fd,
- TestDirectory));
- ::close(fd);
- TestDirectory = path::parent_path(TestDirectory);
+ fs::createUniqueDirectory("FileOutputBuffer-test", TestDirectory));
}
// TEST 1: Verify commit case.
OpenPOWER on IntegriCloud