Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Fix to support verilator tests in chisel3 that use MFC to generate unittests #2594

Open
wants to merge 2 commits into
base: master-deprecated
Choose a base branch
from

Conversation

chick
Copy link
Contributor

@chick chick commented Jan 19, 2023

Fix to support verilator tests in chisel3 that use MFC to generate code for executeExpecting* API

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you update the FIRRTL spec to include every new feature/behavior?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you state the API impact?
  • Did you specify the code generation impact?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • code refactoring

API Impact

Does not change the API structure. Slightly different behavior to support MFC in chisel3

Backend Code Generation Impact

  • does not impact code generation

Desired Merge Strategy

  • Squash: The PR will be squashed and merged (choose this if you have no preference.

Release Notes

Detects "assertion failed" messages in stderr in addition to existing checks on execution success or failure

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (1.2.x, 1.3.0, 1.4.0) ?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you mark as Please Merge?

@chick chick self-assigned this Jan 19, 2023
Comment on lines +190 to 197
stderrLine => {
triggered = triggered || stderrLine
.contains("Assertion failed") || (assertionMessageSupplied && stderrLine.contains(assertionMsg))
logger.warn(stderrLine)
}
)
// Fail if a line contained an assertion or if we get a non-zero exit code
// or, we get a SIGABRT (assertion failure) and we didn't provide a specific assertion message
Copy link
Contributor

@jackkoenig jackkoenig Jan 25, 2023

Choose a reason for hiding this comment

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

Rather than hardcoding the assertion message, can you instead make this:

  1. Do the same thing that the stdout check does and allow the user to specify the assertion message
  2. Make the return value below do the right thing even without providing Assertion failed? it's already looking for non-zero exit codes, are MFC tests that have assertion failures not returning non-zero?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants