[Reproducers] Only creaate the bottom-most dir

As Pavel noted on the mailing list we should only create the bottom-most
directory if it doesn't exist. This should also fix the test case on
Windows as we can use lit's temp directory.

llvm-svn: 348289
This commit is contained in:
Jonas Devlieghere 2018-12-04 18:16:49 +00:00
parent ce26c27b2a
commit c2820bf23e
2 changed files with 3 additions and 6 deletions

View File

@ -1,10 +1,7 @@
# FIXME: Find out why this fails on Windows.
# UNSUPPORTED: system-windows
# Check that errors are propagated to the driver.
# RUN: not %lldb --capture /bogus 2>&1 | FileCheck %s --check-prefix CAPTURE
# RUN: not %lldb --replay /bogus 2>&1 | FileCheck %s --check-prefix REPLAY
# RUN: not %lldb --capture %t/bogus/bogus 2>&1 | FileCheck %s --check-prefix CAPTURE
# RUN: not %lldb --replay %t/bogus/bogus 2>&1 | FileCheck %s --check-prefix REPLAY
# CAPTURE: unable to create reproducer directory
# REPLAY: unable to load reproducer index

View File

@ -36,7 +36,7 @@ llvm::Error Reproducer::Initialize(ReproducerMode mode,
"unable to create unique reproducer directory", ec);
root.emplace(repro_dir);
} else {
auto ec = sys::fs::create_directories(root->GetPath());
auto ec = sys::fs::create_directory(root->GetPath());
if (ec)
return make_error<StringError>("unable to create reproducer directory",
ec);