Skip to content

Feature request: test selection #73

Description

@absolutely-vivid

Test frameworks for other languages often have a way to filter which test are run, which is useful for iterating on a single test without having to run every test. Examples are cargo test, python's unittest, mix test, and unitest. While gleeunit intends to be a simple test runner, and in the past you've expressed a lack of interest in new features, I think a way to filter based on filename or test name is simple enough and extremely useful for iterating on core packages that it would be a good fit for gleeunit.

My proposal is to add two new command line switches, --include and --exclude that each take a list of function names to include or exclude. To keep things simple, each switch can only be used once, and specifying a test in both include and exclude will cause an error:

Example usage:

gleam test # run all tests
gleam test --include foo_test # only run foo_test
gleam test --include foo_test bar_test # only run foo_test and bar_test
gleam test --exclude baz_test # run all tests except baz_test
gleam test --include foo_test bar_test --exclude bar_test # error! bar_test included and excluded

This should be simple to implement without adding any complexity to the existing code, and can be done without any dependencies outside of gleam_stdlib. If you're interested in this feature I'd be happy to work on it!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions