Improve Pyxsim tester output#57
Open
xross wants to merge 2 commits into
Open
Conversation
Contributor
xross
commented
May 28, 2026
- Color expected comparison output
- Flush setup output before simulator capture
Contributor
There was a problem hiding this comment.
Pull request overview
Improves Pyxsim test reporting by colorizing expected/golden output in the ComparisonChecker and flushing pre-simulator captured stdout/stderr so setup output appears in the right place. Also gates printing of the GOLDEN: line behind a higher verbosity level than the OUTPUT: line.
Changes:
- Add
colorama(>=0.4.6) to runtime dependencies and apply yellow/red ANSI styling to expected output and failure messages intesters.py. - Raise the verbosity threshold for printing
GOLDEN:lines from> 0to> 1, and update the CHANGELOG accordingly. - In
run_on_simulator_, drain any previously captured stdout/stderr viacapfdand re-emit it before the simulator runs so setup output isn't swallowed.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Adds colorama>=0.4.6 to install_requires. |
| requirements.txt | Pins colorama==0.4.6 for the dev/runtime requirements. |
| lib/python/Pyxsim/testers.py | Initializes colorama, colorizes GOLDEN/Expected/Missing output, splits GOLDEN print to verbosity > 1. |
| lib/python/Pyxsim/init.py | Flushes captured setup stdout/stderr through capfd before running the simulator. |
| CHANGELOG.rst | Documents the verbosity change for ComparisonChecker. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * ADDED: Methods in Xsi class for getting the xsim tick frequency | ||
| * CHANGED: Pyxsim CMake build uses XCommon CMake | ||
| * CHANGED: The way time is incremented by time_step for better floating point precision | ||
| * CHANGED: ComparisonChecker only prints expected output when verbosity is 1 or higher (i.e. |
Comment on lines
+154
to
160
| ( | ||
| "Line %d of output not found in expected\n" | ||
| + f" {Fore.YELLOW}Expected (one of matching lines){Style.RESET_ALL}\n" | ||
| + " Actual : %s" | ||
| ) | ||
| % (line_num, line.strip()) | ||
| ) |
- Color expected comparison output - Flush setup output before simulator capture# Please enter the commit message for your changes. Lines starting
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.