Project

General

Profile

Feature #17296

Improve diagnostics of cmake macro errors: cet_test

Added by Gianluca Petrillo over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
07/28/2017
Due date:
% Done:

100%

Estimated time:
1.00 h
Spent time:
Duration:

Description

I have a snippet of CMakeLists.txt like:

cet_test(Track_test
  HANDBUILT
  DATAFILES test_trackproxy.fcl
  TEST_EXEC lar --rethrow-all -c ./test_trackproxy.fcl
  USE_BOOST_UNIT
  )

and I receive the error:
CMake Error at /products/cetbuildtools/v5_09_01/Modules/CetTest.cmake:311 (message):
  cet_test: DATAFILES option is now mandatory: non-option arguments are no
  longer permitted.
Call Stack (most recent call first):
  lardata/test/RecoBaseProxy/CMakeLists.txt:6 (cet_test)

This kind of errors happened to me a number of types, where I mistype a keyword (in this case, I should have split the command line between TEST_EXEC and a TEST_ARGS) and cet_test pushes upon me its interpretation of the error rather than detailing what triggered it.
The simplest solution is to hint which was the error token. In my case, TEST_EXEC is actually a valid keyword, so I believe the error token was --rethrow-all. If the message had said:
CMake Error at /products/cetbuildtools/v5_09_01/Modules/CetTest.cmake:311 (message):
  cet_test: non-option argument found: '--rethrow-all'. Non-option arguments are no longer permitted. Also note that DATAFILES option is now mandatory.
Call Stack (most recent call first):
  lardata/test/RecoBaseProxy/CMakeLists.txt:6 (cet_test)

instead of assuming that my mistake of today is from an ancient cet_test breaking change, I would at least been put on the right track.
A more sophisticate logic to detect that I tried to append more arguments to a keyword (TEST_EXEC) than allowed would be ideal, but maybe not worth the effort.

Associated revisions

Revision f9d83bd4 (diff)
Added by Christopher Green over 3 years ago

Fix error message per issue #17296.

History

#1 Updated by Kyle Knoepfel over 3 years ago

  • Status changed from New to Assigned
  • Assignee set to Christopher Green
  • Estimated time set to 1.00 h
  • Experiment LArSoft added
  • Experiment deleted (-)

We will improve the error message.

#2 Updated by Kyle Knoepfel over 3 years ago

  • Project changed from art to cetbuildtools
  • Category deleted (Build System)

#3 Updated by Christopher Green over 3 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Fixed in f9d83bd. Example error message:

CMake Error at /Users/greenc/work/cet-is/products/cetbuildtools/v5_13_01/Modules/CetTest.cmake:370 (message):
  cet_test: Unparsed (non-option) arguments detected: "ethel;lucy;ricky" 

  Check for missing keyword(s) in the definition of test regex_standalone_t
  in your CMakeLists.txt.
Call Stack (most recent call first):
  cetlib/cetlib/test/CMakeLists.txt:135 (cet_test)

#4 Updated by Kyle Knoepfel over 3 years ago

  • Target version set to 2.08.00

#5 Updated by Kyle Knoepfel over 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF