cet_test has confusing error report
cet_test expects a .cc extension unless you specify SOURCES. This differs from art_make, etc. and can cause confusion.
For instance, in attempting to use test_Range.cxx and cet_test(test_Range ...), we get the following error report:
CMake Error at /home/dladams/ups/cetbuildtools/v4_08_01/Modules/CetTest.cmake:273 (ADD_EXECUTABLE): Cannot find source file: test_Range.cc Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx Call Stack (most recent call first): lbtupler/test/LbTupler/CMakeLists.txt:1 (cet_test)
The problem is easily fixed by calling cet_test(test_Range SOURCES test_Range.cxx ... ), but the error report is confusing. Would it be reasonable for cet_test to check for standard extensions? If not, could cet_test please check for the presence of the expected file and throw a fatal error immediately before attempting to use the default file name?
#1 Updated by Christopher Green almost 6 years ago
- Status changed from New to Feedback
- Assignee set to Christopher Green
- Target version set to 1.18.00
- Estimated time set to 1.00 h
- SSI Package cetbuildtools added
- SSI Package deleted (
This can certainly done, and it will take two minutes to implement, but we should run this past the stakeholders because it could break existing builds.