Bug 2127650 - ctest macro errors on short arguments for ctest executable
Summary: ctest macro errors on short arguments for ctest executable
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: cmake
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Björn Esser (besser82)
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-17 19:21 UTC by Otto Liljalaakso
Modified: 2022-11-02 07:28 UTC (History)
6 users (show)

Fixed In Version: cmake-3.25.0-0.3.rc2.fc38
Clone Of:
Environment:
Last Closed: 2022-11-02 07:28:00 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Otto Liljalaakso 2022-09-17 19:21:20 UTC
Description of problem:

If short forms of ctest's parameters, such as "-E some-test",
are passed to %ctest macro,
it fails with error message like "Unknown option E in ctest(:-:)".

Version-Release number of selected component (if applicable):
$ dnf -C info cmake-rpm-macros
Installed Packages
Name         : cmake-rpm-macros
Version      : 3.24.1
Release      : 1.fc38

How reproducible:
Always, I tried both Rawhide and Fedora 36.

Steps to Reproduce:
1. $ rpm --eval '%ctest -E some-test'

Alternatively, try to use that construct in a specfile and run 'fedpkg prep'.

Actual results:
The error message given in description is printed.

Expected results:
Macro evaluates successfully, with following kind of result:

cd "redhat-linux-build" 
  /usr/bin/ctest --output-on-failure --force-new-ctest-process -j4 -E some-test
cd -

Additional info:

Almost all ctest's options also have long forms, which work as expected.
However, there are some (perhaps obscure) that only have short forms (-F, -D),
and also, not supporting short forms prevents packages from just "using ctest parameters".

RPM's own documentation [1] suggests that instead of the form :-: given in the error message,
plain - should be used to define simple passthrough.
Manually editing %ctest (and %ctest3) in /usr/lib/rpm/macros.d/macros.cmake to use that form does fix the problem.

[1]: https://rpm-software-management.github.io/rpm/manual/macros.html

Comment 1 Björn Esser (besser82) 2022-11-02 07:28:00 UTC
https://koji.fedoraproject.org/koji/buildinfo?buildID=2082027


Note You need to log in before you can comment on or make changes to this bug.