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

Add support for multi-threaded test execution #33

Open
cschreib opened this issue Dec 4, 2022 · 3 comments
Open

Add support for multi-threaded test execution #33

cschreib opened this issue Dec 4, 2022 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@cschreib
Copy link
Member

cschreib commented Dec 4, 2022

The framework is written to be thread-safe, but there is currently no way to run tests in parallel. This should be easy to add, but perhaps not without using heap memory. In which case, this will have to be guarded by macros, so it can be disabled if necessary. The heap allocation should be limited to the creation of the threads; everything else we should be able to implement with atomics.

@cschreib cschreib added the enhancement New feature or request label Dec 4, 2022
@cschreib cschreib added this to the v1.x milestone Dec 4, 2022
@cschreib cschreib modified the milestones: v1.1, v1.x Mar 28, 2023
@AdelKS
Copy link

AdelKS commented Apr 16, 2023

Another possibility is to implement what gtest calls "sharding" which is a multi processing approach. You tell the test executable when running it, its index i and N, which is how many you are going to run in parallel, and it will run a specific subset of the tests.

I am writing it here because it didn't see that it's supported in the readme.

@cschreib
Copy link
Member Author

cschreib commented Apr 20, 2023

Hi and thanks for the tip! You are correct, this is not currently supported. I know Catch2 supports this too. Do you know how the different processes get spawned? I.e., is this meant to be supported by an external scheduler / test runner? And do you know how it meshes with test filtering?

@AdelKS
Copy link

AdelKS commented Apr 20, 2023

Do you know how the different processes get spawned? I.e., is this meant to be supported by an external scheduler / test runner?

Yes, the user has to run the test executable N times, and tells each executable their index i and how many subdivisions, N he wants on the tests.

And do you know how it meshes with test filtering?

I do not unfortunately. Although I think it's best to filter first and then subdivide the subset that remains, so it probably does that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants