Skip to content

Commit 497d6d4

Browse files
committed
Modifications in ClangDocMain.cpp to handle new rebased code
Some more cleanup -- redundant code removed Cleanup of test cases according to conventions
1 parent 7449a52 commit 497d6d4

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,7 @@ Example usage for a project using a compile commands database:
301301
}
302302

303303
if (Format == "mustache") {
304-
if (auto Err = getMustacheHtmlFiles(argv[0], CDCtx)) {
305-
llvm::errs() << toString(std::move(Err)) << "\n";
306-
return 1;
307-
}
304+
ExitOnErr(getMustacheHtmlFiles(argv[0], CDCtx));
308305
}
309306

310307
// Mapping phase
@@ -318,7 +315,6 @@ Example usage for a project using a compile commands database:
318315
<< toString(std::move(Err)) << "\n";
319316
else {
320317
ExitOnErr(std::move(Err));
321-
return 1;
322318
}
323319
}
324320

@@ -396,10 +392,7 @@ Example usage for a project using a compile commands database:
396392
llvm::outs() << "Generating docs...\n";
397393
ExitOnErr(G->generateDocs(OutDirectory, std::move(USRToInfo), CDCtx));
398394
llvm::outs() << "Generating assets for docs...\n";
399-
Err = G->createResources(CDCtx);
400-
if (Err) {
401-
llvm::outs() << "warning: " << toString(std::move(Err)) << "\n";
402-
}
395+
ExitOnErr(G->createResources(CDCtx));
403396

404397
return 0;
405398
}
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
// Test: Invalid output path (%t is a file, not a directory)
2-
// RUN: rm -rf %t && echo "not a dir" > %t
3-
// RUN: not clang-doc %s -output=%t/subdir 2>&1 | FileCheck --check-prefix=BAD-OUTPUT %s
1+
/// Invalid output path (%t is a file, not a directory)
2+
// RUN: rm -rf %t && touch %t
3+
// RUN: not clang-doc %s -output=%t/subdir 2>&1 | FileCheck %s
4+
// CHECK: clang-doc error:
5+
// CHECK: {{(Not a directory|no such file or directory)}}
46

5-
// BAD-OUTPUT: clang-doc error:
6-
// BAD-OUTPUT: {{(Not a directory|no such file or directory)}}
7-
8-
//
9-
// Test: Invalid format option
10-
// RUN: not clang-doc %s -format=badformat 2>&1 | FileCheck --check-prefix=BAD-FORMAT %s
11-
12-
// BAD-FORMAT: clang-doc: for the --format option: Cannot find option named 'badformat'!
7+
/// Invalid format option
8+
// RUN: not clang-doc %s -format=badformat 2>&1 | FileCheck %s --check-prefix=BAD-FORMAT
9+
// BAD-FORMAT: clang-doc: for the --format option: Cannot find option named 'badformat'!

0 commit comments

Comments
 (0)