Skip to content

Commit 89cea0d

Browse files
authored
[clang-doc] Fix brittle check in test (#142665)
Instead of having a platform specific error diagnostic, use a fixed one with more direct context for the error.
1 parent 8e77263 commit 89cea0d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clang-tools-extra/clang-doc/tool/ClangDocMain.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ static llvm::Error handleMappingFailures(llvm::Error Err) {
267267

268268
static llvm::Error createDirectories(llvm::StringRef OutDirectory) {
269269
if (std::error_code Err = llvm::sys::fs::create_directories(OutDirectory))
270-
return llvm::createFileError(OutDirectory, Err);
270+
return llvm::createFileError(OutDirectory, Err,
271+
"failed to create directory.");
271272
return llvm::Error::success();
272273
}
273274

clang-tools-extra/test/clang-doc/invalid-options.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: rm -rf %t && touch %t
33
// RUN: not clang-doc %s -output=%t/subdir 2>&1 | FileCheck %s --check-prefix=OUTPUT-FAIL
44
// OUTPUT-FAIL: clang-doc error:
5-
// OUTPUT-FAIL: {{(Not a directory|[Nn]o such file or directory)}}
5+
// OUTPUT-FAIL-SAME: failed to create directory.
66

77
/// Invalid format option.
88
// RUN: rm -rf %t && mkdir %t && touch %t/file

0 commit comments

Comments
 (0)