vunit icon indicating copy to clipboard operation
vunit copied to clipboard

Enter GUI upon failed test?

Open sibeov opened this issue 4 years ago • 7 comments
trafficstars

Hi.

Wondered if it is possible to enter GUI upon the first fail in a test. Is it possible to "catch" the fail someplace and rerun the previous test with the -g flag? Or any other similar "workaround" possible? Would be a nice feature. Was not able to find any information or anything else indicating such a feature exists. If so please redirect me.

Kind regards.

sibeov avatar Sep 16 '21 07:09 sibeov

See #740.

eine avatar Sep 16 '21 07:09 eine

@eine Ah! Thanks. Looks like what I am looking for! I will close issue when I can confirm it works as I wish.

sibeov avatar Sep 16 '21 07:09 sibeov

@sibeov did it resolve your issue ?

dalex78 avatar May 12 '22 19:05 dalex78

Hi @dalex78 !

Sorry for late reply. I have not had the time to check yet because time did not allow me to go further into the matter. I did get some pointers from #740 and tried to create my own XML parsing tool and implement that into a run.py script without any luck. When time permits, I will retry this.

So Sorry for the late response on my part. You may close this issue for now. I can reopen a new issue or similar. If it is no problem this issue can remain open.

Kind regards

sibeov avatar May 19 '22 17:05 sibeov

@sibeov Since you're not looking into re-running a set of failing tests as outlined in #740 you can simply do

python run.py --fail-fast

It stops on the first failing test. If that test is lib.tb_example.failing_test you simply follow up with

python run.py lib.tb_example.failing_test` -g

LarsAsplund avatar May 29 '22 07:05 LarsAsplund

I found this thread after googling "vunit how to open GUI on failed test" and also think it would be very nice to have this work out of the box if possible.

The approach suggested by Lars would not work for tests that generate random data or patterns on every run, would it? For example: generate random data and save to a file using the pre_check functions and pass random patterns via generics, then run the same test multiple times to see if on any particular run a fail will happen. It would be great to have the GUI open and replay that exact test so one can quickly inspect what happened.

In the mean while, I have written routines to dump the random data / patterns for each test as a JSON and a routine that allows me to reload that exact data on a run but it is cumbersome to do so for every testbench.

phlfm avatar Jun 15 '22 19:06 phlfm

@LarsAsplund

Do you mean then to write a script which checks which testcase fails and then run that with the -g flag? Thanks for the tip, it might work. I will see if that works out for me next time I need this. Thanks!

sibeov avatar Jul 14 '22 11:07 sibeov