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

Enable the collection of test of a directory tree #657

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

flieger19
Copy link

No description provided.

@mvandervoord
Copy link
Member

I'm not clear on what this update is building? The main test runner means what?

@flieger19
Copy link
Author

AFAIK the generate_test_runner.rb script can only generate a runner for a single source file with tests. But not for several source files with tests a single common runner.
Accordingly, I have extended the script so that it can also iterate through a directory tree and scan all matching source files there for tests. These are then collected in a common test runner (main runner).

@tango-taylor
Copy link

This would be super useful, I was looking for this exact functionality. I have some tests in C and some in C++ and it seems the easiest way to run them both would be to link one test runner against them.

Copy link

@tango-taylor tango-taylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flieger19 I gave this a try, I think it's a great start. To be complete I think it should have the following:

  • The usage/help text needs to be updated to let the user know it takes directories as input instead of just files.
  • Add some unit tests. This gives usage examples "for free" and builds confidence. The last thing we want is the runner generator to drop tests. Looks like test_generate_test_runner.rb would be a good place to start, I'm sure @mvandervoord would know more (I'm not a dev here).
  • To keep compatibility with how the script handles files right now, it'd be better if it placed all the tests into one runner file. e.g. I tried it with test.c and test_cpp.cpp and it gave me three output files: test_Runner.c, test_cpp_Runner.cpp, testAll_Runner.c. It would be better if it gave me just testAll_Runner.c (or make the name of the output file mandatory so it doesn't have to make up a name). This might also make it easier to integrate with test_generate_test_runner.rb for unit tests.

@astro-stan
Copy link
Contributor

Hi.

I also need this feature. @flieger19 would it be possible to address the notes that @tango-taylor raised, so this can get merged?

Thanks for your work so far!

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

Successfully merging this pull request may close these issues.

4 participants