Skip to content

Improve Pyxsim tester output#57

Merged
xross merged 4 commits into
xmos:developfrom
xross:feat/colors
Jun 4, 2026
Merged

Improve Pyxsim tester output#57
xross merged 4 commits into
xmos:developfrom
xross:feat/colors

Conversation

@xross

@xross xross commented May 28, 2026

Copy link
Copy Markdown
Contributor

This ended up going away beyond the original feature branch naming of "colors"..

  • Add verbosity support to Pyxsim.run_on_simulator_() so captured simulator output is printed when pytest is run with -v, while preserving capfd capture for tester comparisons.
  • Flush any setup output before simulator capture starts so pre-existing stdout/stderr is still visible.
  • Improve ComparisonTester verbose output:
    • only print expected/golden lines at verbosity level 2 or higher (-vv)
    • color expected/missing comparison output for readability
    • reuse tester suppression rules for verbose simulator output
    • report colored summary counts for suppressed multidrive and ignored output lines
  • Add colorama as a dependency for colored terminal output.

This comment was marked as outdated.

xross added 2 commits May 28, 2026 18:24
- Color expected comparison output
- Flush setup output before simulator capture# Please enter the commit message for your changes. Lines starting
Allow Pyxsim.run_on_simulator_() to accept a verbosity argument and print captured simulator output when verbosity is enabled, while preserving capfd capture for tester comparisons.
@xross xross requested a review from humphrey-xmos June 4, 2026 14:23
Teach run_on_simulator_() to tee captured simulator output when verbosity is enabled while preserving capfd capture for tester comparisons.
Reuse ComparisonTester filtering for verbose output so suppressed multidrive and ignored lines are hidden from the live log, with colored summary counts emitted
after the filtered output.

@humphrey-xmos humphrey-xmos left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A much better experience. Thanks.

An observation, on a failing test, I always see the Expected/Actual output as it is failing on that, but with -vv I also get Output/Golden, which is essentially the same.
Useful to be able to see the output on a passing test though.

@xross

xross commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

A much better experience. Thanks.

An observation, on a failing test, I always see the Expected/Actual output as it is failing on that, but with -vv I also get Output/Golden, which is essentially the same. Useful to be able to see the output on a passing test though.

okay, I'll take a look and make this nicer in a new pr

@xross xross merged commit 1f7cd1e into xmos:develop Jun 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants