Skip to content

Add test_configuration to SameSimTestSuite to fix --export-json (fixes #1138) - #1230

Open
mustafacicek-eee wants to merge 1 commit into
VUnit:masterfrom
mustafacicek-eee:fix-1138-export-json-same-sim
Open

mustafacicek-eee wants to merge 1 commit into
VUnit:masterfrom
mustafacicek-eee:fix-1138-export-json-same-sim

Conversation

@mustafacicek-eee

Copy link
Copy Markdown

Description

Fixes #1138.

When exporting tests to JSON using --export-json, _main_export_json() iterates over all test suites and accesses test_suite.test_configuration to retrieve the test configuration mapping for each test case:

test_information = test_suite.test_information
test_configuration = test_suite.test_configuration
for name in test_suite.test_names:
    info = test_information[name]
    config = test_configuration[name]

When testbenches specify -- vunit: run_all_in_same_sim, tests are grouped into a SameSimTestSuite rather than TestSuiteWrapper. SameSimTestSuite defines test_names and test_information, but was missing the test_configuration property, resulting in:

AttributeError: 'SameSimTestSuite' object has no attribute 'test_configuration'

Solution

  1. Added test_configuration property to SameSimTestSuite in vunit/test/suites.py, returning a dictionary mapping each full test name to self._configuration (mirroring test_information).
  2. Added unit test test_export_json_same_sim in tests/unit/test_ui.py to test --export-json on testbenches with same_sim=True.
  3. Added news fragment docs/news.d/1138.bugfix.rst.

Verification

Ran the unit test suite:

  • test_export_json passed.
  • test_export_json_same_sim 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.

--export-json issues AttributeError: 'SameSimTestSuite' object has no attribute 'test_configuration'

1 participant