@@ -37,57 +37,85 @@ The :vunit_example:`VHDL User Guide Example <vhdl/user_guide/>` can be run to pr
3737 .. code-block :: console
3838 :caption: Run all tests
3939
40- > python run.py -v lib.tb_example*
41- Running test: lib.tb_example.all
42- Running test: lib.tb_example_many.test_pass
43- Running test: lib.tb_example_many.test_fail
44- Running 3 tests
40+ > python run.py
41+ Re-compile not needed
4542
46- running lib.tb_example.all
47- Hello World!
48- pass( P=1 S=0 F=0 T=3) lib.tb_example.all (0.1 seconds)
43+ (09:40:59) Starting lib.tb_example.all
44+ Output file: C:\vunit\examples\vhdl\user_guide\vunit_out\test_output\lib.tb_example.all_7b5933c73ddb812488c059080644e9fd58c418d9\output.txt
45+ pass ( P=1 S=0 F=0 T=3) lib.tb_example.all (0.5 s)
4946
50- running lib.tb_example .test_pass
51- This will pass
52- pass (P=2 S=0 F=0 T=3) lib.tb_example_many.test_pass (0.1 seconds)
47+ (09:40:59) Starting lib.tb_example_many .test_pass
48+ Output file: C:\vunit\examples\vhdl\user_guide\vunit_out\test_output\lib.tb_example_many.test_pass_aff64431373db20d8bbba18c28096f449861ccbe\output.txt
49+ pass (P=2 S=0 F=0 T=3) lib.tb_example_many.test_pass (0.5 s)
5350
54- running lib.tb_example.test_fail
55- Error: It fails
56- fail (P=2 S=0 F=1 T=3) lib.tb_example_many.test_fail (0.1 seconds)
51+ (09:41:00) Starting lib.tb_example_many.test_fail
52+ Output file: C:\vunit\examples\vhdl\user_guide\vunit_out\test_output\lib.tb_example_many.test_fail_d8956871e3b3d178e412e37587673fe9df648faf\output.txt
53+ Seed for lib.tb_example_many.test_fail: 7efb6d37186ac077
54+ C:\vunit\examples\vhdl\user_guide\tb_example_many.vhd:26:9:@0ms:(assertion error): It fails
55+ ghdl:error: assertion failed
56+ ghdl:error: simulation failed
57+ fail (P=2 S=0 F=1 T=3) lib.tb_example_many.test_fail (0.5 s)
5758
5859 ==== Summary =========================================
59- pass lib.tb_example.all (0.1 seconds )
60- pass lib.tb_example_many.test_pass (0.1 seconds)
61- fail lib.tb_example_many.test_fail (0.1 seconds )
62- ======================================================
60+ pass lib.tb_example.all (0.5 s )
61+ pass lib.tb_example_many.test_pass (0.5 s)
62+ fail lib.tb_example_many.test_fail (0.5 s )
63+ ======================================================
6364 pass 2 of 3
6465 fail 1 of 3
6566 ======================================================
66- Total time was 0.3 seconds
67- Elapsed time was 0.3 seconds
67+ Total time was 1.5 s
68+ Elapsed time was 1.5 s
6869 ======================================================
6970 Some failed!
7071
72+ By default, test output is shown only for failing tests. To display output for all tests, use the ``-v `` option. The example below demonstrates this,
73+ while also selecting a subset of tests using a test pattern.
74+
7175.. code-block :: console
72- :caption: Run a specific test
73-
74- > python run.py -v lib.tb_example.all
75- Running test: lib.tb_example.all
76- Running 1 tests
77-
78- Starting lib.tb_example.all
79- Hello world!
80- pass (P=1 S=0 F=0 T=1) lib.tb_example.all (0.1 seconds)
81-
82- ==== Summary ==========================
83- pass lib.tb_example.all (0.9 seconds)
84- =======================================
85- pass 1 of 1
86- =======================================
87- Total time was 0.9 seconds
88- Elapsed time was 1.2 seconds
89- =======================================
90- All passed!
76+ :caption: Run specific test(s) matching a pattern
77+
78+
79+ > python run.py -v lib.tb_example_many*
80+ Re-compile not needed
81+
82+ Running test: lib.tb_example_many.test_pass
83+ Running test: lib.tb_example_many.test_fail
84+ Running 2 tests
85+
86+ (09:57:18) Starting lib.tb_example_many.test_fail
87+ Output file: C:\vunit\examples\vhdl\user_guide\vunit_out\test_output\lib.tb_example_many.test_fail_d8956871e3b3d178e412e37587673fe9df648faf\output.txt
88+ Seed for lib.tb_example_many.test_fail: 2c14af95ae82a231
89+ C:\vunit\examples\vhdl\user_guide\tb_example_many.vhd:26:9:@0ms:(assertion error): It fails
90+ ghdl:error: assertion failed
91+ ghdl:error: simulation failed
92+ fail (P=0 S=0 F=1 T=2) lib.tb_example_many.test_fail (3.2 s)
93+
94+ (09:57:22) Starting lib.tb_example_many.test_pass
95+ Output file: C:\vunit\examples\vhdl\user_guide\vunit_out\test_output\lib.tb_example_many.test_pass_aff64431373db20d8bbba18c28096f449861ccbe\output.txt
96+ Seed for lib.tb_example_many.test_pass: 30e3764e6f87ca85
97+ C:\vunit\examples\vhdl\user_guide\tb_example_many.vhd:23:9:@0ms:(report note): This will pass
98+ simulation stopped @0ms with status 0
99+ pass (P=1 S=0 F=1 T=2) lib.tb_example_many.test_pass (0.5 s)
100+
101+ ==== Summary =========================================
102+ pass lib.tb_example_many.test_pass (0.5 s)
103+ fail lib.tb_example_many.test_fail (3.2 s)
104+ ======================================================
105+ pass 1 of 2
106+ fail 1 of 2
107+ ======================================================
108+ Total time was 3.6 s
109+ Elapsed time was 3.7 s
110+ ======================================================
111+ Some failed!
112+
113+ Note that the order of test execution has changed - the failing test is now run first. VUnit reorders tests based on
114+ previous results and recent code changes to achieve two main goals:
115+
116+ 1. Prioritize likely failures - Tests more likely to fail are executed earlier to provide faster feedback. In this case, ``lib.tb_example_many.test_fail ``
117+ has a history of failing, and no relevant code changes have been made, so it is assumed to fail again and is run first.
118+ 2. Load balancing - When tests are executed in parallel using the ``-p `` option, VUnit distributes them across threads to minimize to total execution time.
91119
92120Opening a Test Case in Simulator GUI
93121====================================
0 commit comments