Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 926785 - cmake.eclass: ctest doesn't accept floating point arguments for --test-load
Summary: cmake.eclass: ctest doesn't accept floating point arguments for --test-load
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-11 23:19 UTC by Alexander Miller
Modified: 2024-03-13 20:52 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Miller 2024-03-11 23:19:46 UTC
In cmake_src_test(), the argument for ctest's --test-load option is obtained
by calling makeopts_loadavg from multiprocessing.eclass. This may result in
a floating point value, but ctest expects an integer. When the user has set
a non-integral value in MAKEOPTS, ctest prints a warning and ignores the
option (i.e., it runs all tests at once if -j is unlimited).

This should be fixed by converting the value to integer.
* The simplest (but incomplete) solution is to strip everything after a
  decimal point.
* A general solution needs proper floating point parsing, and there aren't
  many options without extra dependencies. I think we could use awk, though;
  it's in the system set of the base profile. The following should work
  and be very robust (maybe cange rounding behavior?):
  awk '{print int($1 > 9999 ? 9999 : $1 > 1 ? $1 : 1);}'

Another question is whether the fix should be put right in cmake_src_test
or if it would make sense to provide an integral makeopts_loadavg variant
in multiprocessing.eclass.
Comment 1 Mike Gilbert gentoo-dev 2024-03-13 20:52:55 UTC
Another alternative would be to change ctest to accept a float.