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

Test Scanner is filename case sensitive #138

Closed
joshrsmith opened this issue Feb 29, 2016 · 4 comments
Closed

Test Scanner is filename case sensitive #138

joshrsmith opened this issue Feb 29, 2016 · 4 comments
Assignees

Comments

@joshrsmith
Copy link
Contributor

I thought that based on previous discussion, including the runner_cfg generic would be enough for VUnit to pickup a testbench to run tests on. It appears that both the entity and filename of the testbench must also meet the following rules:

def tb_filter(entity):
    """
    Filters entities with both file name and entity name matching tb_* or *_tb.
    """
    # Above docstring can show up in ui.py warnings
    file_ok = basename(entity.file_name).startswith("tb_") or splitext(basename(entity.file_name))[0].endswith("_tb")
    entity_ok = entity.name.startswith("tb_") or entity.name.endswith("_tb")

    if file_ok and entity_ok:
        return True
    return False

This was a problem for me because a testbench was named myblock_TB.vhd instead of myblock_tb.vhd.

I suggest that the scanner allow any case when filtering on tb_* or *_tb.

It might be worth considering bypassing the naming rules if the entity contains the runner_cfg generic.

Regardless, a note should also be added to the documentation that the testbench files and entities must be named in a specific way in order for the scanner to pick them up.

@kraigher
Copy link
Collaborator

kraigher commented Mar 1, 2016

I think we should change the rule to be based on the prescence of runner_cfg. The old rule was created before there was any runner_cfg.

@joshrsmith
Copy link
Contributor Author

A rule based on runner_cfg makes sense, if it is required for proper operation of VUnit. If a testbench will work without runner_cfg, then perhaps the existing rule should be updated.

I was surprised after my discussion about #130 when legacy testbenches were scanned/discovered by VUnit when they did not have runner_cfg at all (but they did match current entity/file naming rules).

@kraigher
Copy link
Collaborator

kraigher commented Mar 2, 2016

I will base the rule entirely on the availability of runner_cfg generic or parameter. I will also give a warning if a module or entity has a runner_cfg without being named tb_* or *_tb case insensitive. A warning will also be given if a test bench is named according to the pattern but does not have a runner_cfg. I think the warning is good to encourage some consistency as well as catch unintendend mistakes.

@cmarqu This will affect the use of test benches where the tests are not at the top level. Your nested module with the TEST_SUITE will be detected to have a runner_cfg. Therefore I will add a NESTED_TEST_SUITE macro that you can use that instead creates a nested_runner_cfg parameter.

Sounds good?

@cmarqu
Copy link
Contributor

cmarqu commented Mar 2, 2016

Sounds good to me, yes.

@kraigher kraigher self-assigned this Mar 2, 2016
@kraigher kraigher closed this as completed Mar 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants