[PATCH] D21360: test-suite cmake: Detect test subdirectories when running cmake.
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 15 15:51:10 PDT 2016
tra added a comment.
In http://reviews.llvm.org/D21360#458253, @MatzeB wrote:
> > Do you have particular use case for wildcard search?
> I guess this is a matter of preference. I personally find it very convenient to simply move additional test-suites as a subdirectory of my test-suite checkout. So I can already express the list of tests I want to run simply by moving directories in and out of the test-suite checkout.
> This is also similar to how the tools/ and projects/ directories in llvm work where you can drop stuff like compiler-rt, libcxx, clang etc. as you need them.
> My question was more about whether we should restrict the wildcard matching to a well-known subdirectory (say 'projects' to stay in line with llvm or maybe the existing 'External' directory).
I think what we want to do is, as @jmolloy said, "decouple the drivers from the test-suite".
Searching at the top of test-suite source tree is both unnecessarily wide (there are directories we don't want) and and may not even be the right place to search (tests we want may be somewhere else). What we do want is a way to tell where to find extra tests and pick them up with as little hassle as possible.
Your patch is almost there. It allows specifying where tests are via TEST_SUITE_SUBDIRS, but does not do searching there.
It searches for tests in the source tree, but only if TEST_SUITE_SUBDIRS is not specified.
How about this:
for dir in TEST_SUITE_SUBDIRS:
if $dir has(CMakeLists.txt)
find and add $dir/*/CMakeLists.txt
Then we can add an empty External/Extra directory within source tree and set TEST_SUITE_SUBDIRS=External/Extra by default.
This way any extra tests placed in External/Extra will be picked up by default without any special configuration options.
If user wants something else he can add whatever additional directory he wants and will have a way to do it either one directory at a time or provide a place for wildcard search of directories.
Explicitly named directories should probably be cached.
Wildcard ones we should pick up without reconfiguration.
Does it make sense?
More information about the llvm-commits