On 28.01.2015 01:38, Robert Dailey wrote:
I suspect that per David's suggestion, CTest would essentially do what
you're doing but in a more thorough manner (based on the test
framework used). So essentially CTest will need:
- A new command line parameter that specifies the test framework
- Functionality to parse the contents of source files provided to the
target the test is assigned to
I'll try to look into this when I can. David, if you have more
specific requirements or pointers please do share them here. Thanks
for the input everyone.
CMake generates "CTestTestfile.cmake" files which contain the code that
defines tests during execution of ctest itself.
Those "CTestTestfile.cmake" files could use execute_process() to query
test binaries for their contained tests and then add tests appropriately.
With that approach there would be no need to parse source files.
This can already be done in a hackish way by using the
TEST_INCLUDE_FILE[1] directory property.
file(GENERATE) can be used to create per-test-binary/per-configuration
snippets with executable locations ($<TARGET_FILE>) which then can be
globbed for and included by CTestTestfile.cmake.
I would still opt for implementing support for this in cmake itself
though since the entire logic could be contained in the generated
"CTestTestfile.cmake"s.
Perhaps with a couple of properties that would define how to e.g. query
the list of tests and the required parameter to run a specific test;
that way it could be made to work irregardless of which test framework
is being used.
Nils
[1] http://www.cmake.org/cmake/help/v3.1/prop_dir/TEST_INCLUDE_FILE.html
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake