Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Clean up tests/CMakeLists.txt #115

Open
jdiez17 opened this issue Mar 9, 2015 · 4 comments
Open

Clean up tests/CMakeLists.txt #115

jdiez17 opened this issue Mar 9, 2015 · 4 comments

Comments

@jdiez17
Copy link
Contributor

jdiez17 commented Mar 9, 2015

Instead of manually adding three lines per unit test, cmake should go through every test_*.cpp file and add it to the unit test list automatically.

@darioizzo
Copy link
Member

Good idea, but there are some tests that need to be compiled only if some of the build options are activated. How would you deal with those?

@bluescarni
Copy link
Member

Why not writing a small macro to wrap those three lines in one instead?

I am not a fan of auto-discovery or file globbing in these cases. The list of tests (or, a list of source files more generally) is not going to change often, and globbing can make it quite hard to understand what is going on (e.g., if you have temporary .cpp files in there for debug or whatever).

@jdiez17
Copy link
Contributor Author

jdiez17 commented Mar 9, 2015

Good point, globbing might not be the best way. We could have a list of
tests, and the build options that need to be activated to run each test.

On Mon, 9 Mar 2015 12:45 Francesco Biscani [email protected] wrote:

Why not writing a small macro to wrap those three lines in one instead?

I am not a fan of auto-discovery or file globbing in these cases. The list
of tests (or, a list of source files more generally) is not going to change
often, and globbing can make it quite hard to understand what is going on
(e.g., if you have temporary .cpp files in there for debug or whatever).


Reply to this email directly or view it on GitHub
#115 (comment).

@bluescarni
Copy link
Member

@jdiez17 Just for reference, this is a possible way of doing it:

https://github.com/bluescarni/piranha/blob/master/tests/CMakeLists.txt

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants