-
Notifications
You must be signed in to change notification settings - Fork 302
Some test refactoring #357
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
5 commits
Select commit
Hold shift + click to select a range
11ad182
increase default pytest timeout to 481s
aaronliu0130 1e39bff
remove duplicate boost sample for testing inspect headers
aaronliu0130 c0eb131
use pytest parametrized instead of parameterized & google todo credit
aaronliu0130 e91570a
add script to update CLI test definitions
aaronliu0130 b75ec85
Merge branch 'develop' into testbuxer
cclauss 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
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,48 @@ | ||
| #!/bin/zsh | ||
|
|
||
| # Input the path of cpplint here | ||
| cpplint="$HOME/Documents/cpplint/cpplint.py" | ||
|
|
||
| cd samples/ || exit 74 # EX_IOERROR | ||
|
|
||
| # Loop through all .def files in the given directories | ||
| folders=(${(f)"$(cat)"}) | ||
| for folder in $folders; do | ||
| cd "$folder-sample/" || exit 66 # EX_NOINPUT | ||
| for file in ./*.def; do | ||
| if [[ ! -s "$file" ]]; then | ||
| echo "Skipping empty file: $file" | ||
| continue | ||
| fi | ||
| echo "Processing $file..." | ||
|
|
||
| # Extract the command from the first line of the file | ||
| cmd=$(head -n 1 "$file") | ||
|
|
||
| # Create temporary files for stdout and stderr | ||
| stdout_file=$(mktemp) | ||
| stderr_file=$(mktemp) | ||
|
|
||
| # Execute the command and capture stdout and stderr | ||
| uv run "$cpplint" $cmd > "$stdout_file" 2> "$stderr_file" | ||
| ret_code=$? | ||
|
|
||
| # Count the number of lines in stdout | ||
| (( num_lines=$(wc -l < "$stdout_file") + 1 )) | ||
|
|
||
| # Overwrite the original definition file | ||
| { | ||
| echo "$cmd" | ||
| echo "$ret_code" | ||
| echo "$num_lines" | ||
| cat "$stdout_file" | ||
| echo | ||
| cat "$stderr_file" | ||
| echo | ||
| } > "$file" | ||
|
|
||
| # Clean up temporary files | ||
| rm "$stdout_file" "$stderr_file" | ||
| done | ||
| cd .. | ||
| done |
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
samples/boost-sample/headers_inspect.def → .../boost-sample/headers_inspect_exclude.def
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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| src/inspect/* | ||
| --recursive "--exclude=src/tr1/*" src | ||
| 1 | ||
| 3 | ||
| Done processing src/inspect/unnamed_namespace_check.hpp | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a massive change. Is there a particular versions of Python and/or operating system that is so slow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not that it's slow, it's that I oftentimes find myself having to debug the tests, for which 1 minute is not enough for. My average debugging time is about 5 minutes, and 418 is my favorite number.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
481 != 418 ;-)
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/418