Feature #22690

Improve portability of CetTest

Added by Ben Morgan almost 2 years ago. Updated almost 2 years ago.

Under Discussion
Target version:
Start date:
Due date:
% Done:


Estimated time:


I've been testing the Spack-MVP1 feature branches up to Art, admittedly quickly outside of spack-dev, and found a couple of issues with CetTest:

  1. cet_test_exec has a dependence on GNU getopt, which may not be present (at least on macOS)
  2. CetTest uses relative/base paths to test executables, and so relies on PATH being set up though CMake/CetTest can easily find the exact paths. Using these full paths is more reliable in case of any clashes.

I've prepared a branch on a GitHub fork:

with two commits:

  1. Provides a pure bash implementation of GNU getopt in cet_test_exec
  2. Set CET_TEST_EXEC by expanding a generator expression for the built target, or from the known full path to a script copied by cet_script

There may be a few corner cases for CET_TEST_EXEC.

Whilst these are outside of spack-dev, I think they would simplify usage in that environment as well.


#1 Updated by Kyle Knoepfel almost 2 years ago

  • Assignee set to Patrick Gartung
  • Status changed from New to Under Discussion

Patrick will take a look.

#2 Updated by Ben Morgan almost 2 years ago

For further info, I've identified two additional places affected by use of relative paths/PATH to known resources:

I'll add a proposed fix for these to the same branch.

#3 Updated by Ben Morgan almost 2 years ago

Ben Morgan wrote:

I'll add a proposed fix for these to the same branch.

Now done on branch:
in commit:

This should now be ready for testing at FNAL. I've confirmed this resolves the given issues on a CentOS7 build for MVP1a branches of cetlib_except through to art.

#4 Updated by Ben Morgan almost 2 years ago

One further commit has been added to resolve the case where output of cet_script is used as input to cet_test via HANDBUILT TEST_EXEC.

This was identified in art_root_io, and with this fix, all Spack-MVP1a branches are working up to the critic level.

Also available in: Atom PDF