Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify test case(s) to run after creating a VUnit instance? #1010

Open
cjmeyer opened this issue Apr 23, 2024 · 0 comments
Open

How to specify test case(s) to run after creating a VUnit instance? #1010

cjmeyer opened this issue Apr 23, 2024 · 0 comments

Comments

@cjmeyer
Copy link

cjmeyer commented Apr 23, 2024

Is there a way to create the VUnit object and then specify the test case(s) to run? What I would like to do is create an instance of VUnit , call add_library(), add_source_files(), etc, and then specify the test case(s) I would like to run just before, or when, I call main(). It would maybe look something like:

vu = VUnit.from_args( ... )
vu.add_vhdl_builtins()

lib = vu.add_library('my_lib')
lib.add_sources(['src/*.vhd', 'tb/*.vhd'])

vu.main('my_lib.my_module.test_1')

My use case is using composable pytest fixtures to configure an instance of VUnit and then in the test case call main() (or equivalent) on the VUnit instance to actually build and run the simulation. One pytest fixture would create the base VUnit instance, and then successive fixtures would create libraries, add sources, set generics, etc, until the main test function called main().

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

No branches or pull requests

1 participant