Skip to content

Feature Request: Add a Top-Level make test Target #2063

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

Open
rafaelvzago opened this issue Apr 9, 2025 · 0 comments · May be fixed by #2067
Open

Feature Request: Add a Top-Level make test Target #2063

rafaelvzago opened this issue Apr 9, 2025 · 0 comments · May be fixed by #2067
Assignees
Labels
test Issue or activity associated with test development and operation

Comments

@rafaelvzago
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently, there isn't a straightforward way to execute the tests located in the tests/ subdirectory directly from the top-level Makefile. Developers need to navigate into the tests/ directory and then run make to execute the test targets. This adds an extra step and can be inconvenient, especially when wanting to run tests frequently or as part of a larger build/test workflow from the project root.

Describe the solution you'd like
I would like to add a new target to the main Makefile that, when executed, navigates to the tests/ subdirectory and runs the targets defined within the tests/Makefile. Ideally, this new target would allow specifying which targets in the tests/Makefile to execute (e.g., make test-all, make test-unit). A default target could also be defined to run a standard set of tests.

Describe alternatives you've considered
One alternative is to always cd tests/ and run make from there. However, this requires the developer to manually change directories. Another alternative could be to copy the test targets into the main Makefile, but this would lead to duplication and make maintenance more difficult as the test logic evolves.

Additional context
This feature would improve the developer experience by providing a more convenient way to run tests. It would also make it easier to integrate test execution into automated build and CI/CD pipelines triggered from the project root. A possible implementation could involve using the -C flag of the make command to change the directory before executing the targets in the tests/Makefile. For example, a target named test in the main Makefile could be defined as:

test:
	$(MAKE) -C tests/

Or to run a specific target within the tests/Makefile:

e2e-tests:
	$(MAKE) -C tests/ unit

This approach leverages the existing Makefile within the tests/ directory and avoids duplicating any test definitions.

test-unit:
	$(MAKE) -C tests/ unit

This approach leverages the existing Makefile within the tests/ directory and avoids duplicating any test definitions.

@rafaelvzago rafaelvzago self-assigned this Apr 9, 2025
@rafaelvzago rafaelvzago added the test Issue or activity associated with test development and operation label Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issue or activity associated with test development and operation
Projects
Status: To do
Development

Successfully merging a pull request may close this issue.

1 participant