Test Updates, master branch (2018.03.13.)
This MR is meant to replace !250 (closed), and address issues brought up in ATLINFR-2296 and in https://gitlab.cern.ch/atlas/athena/merge_requests/9258.
In the end I decided to do something much simpler than what @fwinkl was suggesting. First off, I didn't want to change the default behaviour of atlas_add_test(...)
, that it runs all of its tests in the same directory. Because I do know that a few tests in atlas/athena depend on this behaviour, and I didn't want to update all of them.
Frank was bringing up a reasonable point, that since add_test has a WORKING_DIRECTORY
argument, it could've made sense to add a WORKING_DIRECTORY
argument to atlas_add_test
as well. I contemplated this for a while. But in the end decided that setting the working directory through the general PROPERTIES
argument is just as good.
I was trying for a while to teach atlas_add_test(...)
how to create the run directory at build time based on the "final" WORKING_DIRECTORY
property that was set on the test. But could just not find a way to do this. (There's no generator expression available that would allow us to get test properties.) So the users will have to take care of creating the run directory themselves if they intend to use a non-standard one. Like:
https://gitlab.cern.ch/akraszna/AtlasAddTestTests/blob/master/TestPackage/CMakeLists.txt#L9-13
With all this said, the only thing I changed in this code was to fix the issue with relative paths that Frank brought up in !250 (closed).
Merge request reports
Activity
mentioned in merge request !250 (closed)
Jenkins Build FAILURE Results available at: Jenkins [AE-MERGE-REQUEST #386]
Unfortunately I couldn't find a way to make the code fool proof.
Consider the following for instance:
atlas_add_test( MyTest SCRIPT ... WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/customDir ) ... set_tests_properties( MyPackage_MyTest_ctest PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/someOtherDir )
Even if in this case we auto-create
${CMAKE_CURRENT_BINARY_DIR}/customDir
, the testing will still eventually fail, since the test would need to be executed in${CMAKE_CURRENT_BINARY_DIR}/someOtherDir
after all.And this is perfectly in sync with add_test. That doesn't create any directories either, but relies on the user to make sure the directory exists.
It's definitely not a black or white issue. But I just thought that if somebody has to specify custom run directories for his/her tests, they might as well have to know to create these directories by hand.
P.S. The build failure is because of: https://sft.its.cern.ch/jira/browse/ROOT-9304 A pretty annoying issue...
Jenkins Build SUCCESS Results available at: Jenkins [AE-MERGE-REQUEST #389]
mentioned in commit 4d315de6
mentioned in commit d338b6f9
mentioned in merge request !257 (merged)