VUnit/vunit

Attributes on specific configuration of a test

crdavis12 opened this issue · 2 comments

Currently it's possible to add attributes on Test or on TestBench objects. I'd like to be able to put attributes on specific configurations of specific Tests.

We use attributes to label long-running simulations and run those less frequently. Often it is the configuration (combination of generics) that causes a long runtime, so there are situations where a given combination of Configuration + Test is long-running, but not all tests of that configuration and not all configurations of that test.

Edit: I found that it's possible to put attributes on a configuration with this:
testbench.add_config(attributes={})
I don't think there's a way to apply attributes to a specific combo of Configuration + Test.

For example, if I have:

mytb.config_1.testA
mytb.config_1.testB
mytb.config_2.testA
mytb.config_2.testB

I'd like to be able to put an attribute on just mytb.config_1.testB.

It's also possible to add configurations on individual tests. What you can do is something like this:

mytb = mylib.test_bench("mytb")
mytb.add_config(name="config2", ...)
for test in mytb.get_tests():
    test.add_config(name="config1", attributes={".attr": value} if test.name == "testB" else {}, ...)

Thanks for the tip! I forgot that you could add_config on individual tests.