Files
faumaray ca04975d54 bootstrap
Signed-off-by: faumaray <faumaray@gmail.com>
2026-11-25 02:11:19 +03:00

33 lines
1.4 KiB
CMake

cmake_minimum_required(VERSION 4.0)
foreach(suite IN ITEMS UNIT CAPABILITIES PROCESS)
execute_process(COMMAND "${${suite}}" --list --no-color
RESULT_VARIABLE code OUTPUT_VARIABLE out ERROR_VARIABLE err TIMEOUT 5)
if(NOT "${code}" STREQUAL "0" OR NOT "${err}" STREQUAL "")
message(FATAL_ERROR "${suite} discovery failed: ${code}\n${out}\n${err}")
endif()
string(REPLACE "\n" ";" cases "${out}")
list(FILTER cases EXCLUDE REGEX "^$")
list(LENGTH cases count)
if(suite STREQUAL "UNIT")
set(minimum 22)
elseif(suite STREQUAL "CAPABILITIES")
set(minimum 6)
else()
set(minimum 9)
endif()
if(count LESS minimum)
message(FATAL_ERROR "${suite} registered ${count} tests; expected at least ${minimum}")
endif()
message(STATUS "${suite}: ${count} registered cases")
endforeach()
# Execute an actual body, observing runner count and exit code rather than relying
# only on a nonempty list from the source scanner.
execute_process(COMMAND "${UNIT}" --no-color --filter "^FramingTests.exact_frame_limits$"
RESULT_VARIABLE code OUTPUT_VARIABLE out ERROR_VARIABLE err TIMEOUT 5)
if(NOT "${code}" STREQUAL "0" OR NOT out MATCHES "1 tests:" OR
NOT out MATCHES "exact_frame_limits")
message(FATAL_ERROR "Named regression did not execute successfully: ${code}\n${out}\n${err}")
endif()