-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[clang-doc] Refactor error handling to use ExitOnError #141699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f0b3184
[clang-doc] Refactor error handling to use ExitOnError
snarang181 daab868
Addressing PR feedback
snarang181 05328e9
Clang-format fixes
snarang181 fb8ca57
Use more relevant file system API for error handling
snarang181 76140a2
Formatting commit
snarang181 abdae47
Rename test file to reflect multiple test cases
snarang181 7449a52
Modifying expected result to iron out cross-platform output diff
snarang181 497d6d4
Modifications in ClangDocMain.cpp to handle new rebased code
snarang181 f57b3cf
Add more test cases for clang-doc failures
snarang181 1a41b0f
Add explicit output dir in test case
snarang181 49da327
Wrap executor in ExitOnErr and modify uses
snarang181 2657c20
Run clang-format
snarang181 49d039b
Add helper for handling mapping phase errors
snarang181 94ca232
Incorporating suggestions in the lit test
snarang181 1ff0f91
Add helper function for handling error handling
snarang181 66e9d5e
Remove same comment
snarang181 74abce8
Renaming functions, making them static, some more cleanup
snarang181 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/// Invalid output path (%t is a file, not a directory). | ||
// RUN: rm -rf %t && touch %t | ||
// RUN: not clang-doc %s -output=%t/subdir 2>&1 | FileCheck %s --check-prefix=OUTPUT-FAIL | ||
// OUTPUT-FAIL: clang-doc error: | ||
// OUTPUT-FAIL: {{(Not a directory|no such file or directory)}} | ||
|
||
/// Invalid format option. | ||
// RUN: rm -rf %t && mkdir %t && touch %t/file | ||
// RUN: not clang-doc %s --output=%t/file -format=badformat 2>&1 | FileCheck %s --check-prefix=BAD-FORMAT | ||
// BAD-FORMAT: clang-doc: for the --format option: Cannot find option named 'badformat'! | ||
|
||
/// Missing HTML asset directory (warning only). | ||
// RUN: clang-doc %s -format=html -asset=%t/nonexistent-assets 2>&1 | FileCheck %s --check-prefix=ASSET-WARN | ||
// ASSET-WARN: Asset path supply is not a directory | ||
|
||
/// Mapping failure (with --ignore-map-errors=false). | ||
// RUN: not clang-doc %t/nonexistent.cpp -ignore-map-errors=false 2>&1 | FileCheck %s --check-prefix=MAP-FAIL | ||
// MAP-FAIL: clang-doc error: Failed to run action | ||
|
||
/// Mapping failure (with --ignore-map-errors=true). | ||
// RUN: clang-doc %t/nonexistent.cpp 2>&1 | FileCheck %s --check-prefix=MAP-WARN | ||
// MAP-WARN: Error mapping decls in files. Clang-doc will ignore these files and continue | ||
|
||
///Invalid executor type | ||
// RUN: not clang-doc --executor=invalid %s 2>&1 | FileCheck %s --check-prefix=EXECUTOR-FAIL | ||
// EXECUTOR-FAIL: clang-doc error: | ||
// EXECUTOR-FAIL: Executor "invalid" is not registered | ||
ilovepi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
///TODO: Add tests for failures in generateDocs() and in createResources(). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.