CTest: unknown error on non-interger slot number in RESOURCE_GROUPS
If the slot number for a given resource within RESOURCE_GROUPS
is a non-interger number, e.g. 1.0
ctest
fails with set_tests_properties unknown error
. See below:
cmake_minimum_required(VERSION 3.18)
project(TESTS LANGUAGES NONE)
include(CTest)
add_test(NAME MyTest COMMAND sleep 0.1)
set_tests_properties(MyTest PROPERTIES RESOURCE_GROUPS "foo:1.0")
~/cmake/build/bin/ctest --version
ctest version 3.21.20210715-g769c539
CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ ~/cmake/build/bin/ctest --output-on-failure --no-tests=error -j 2
Test project /home/steal/tmp/cmake/build
CMake Error at CTestTestfile.cmake:8 (set_tests_properties):
set_tests_properties unknown error.
Errors while running CTest
This is not an issue by itself, but rather misleading. It took me a while to notice that my numbers changed from int to float within my Python script I use to generate the RESOURCE_GROUPS
property automatically. If possible the error message can be improved to indicate that the slot is not an integer.