Files
Build-System/tests/DescribeContracts.cmake
T
faumaray 8e3fffd636
VoidBuildSystem CI / 1 · Requirements (push) Successful in 6s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 4m17s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 4m25s
VoidBuildSystem CI / 2B · Windows Wine build (sanitizers) (push) Successful in 5m11s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 5m25s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 6m12s
VoidBuildSystem CI / 2C · Windows native build (debug) (push) Successful in 6m20s
VoidBuildSystem CI / 2C · Windows native build (sanitizers) (push) Failing after 22s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 3m35s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 1m38s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 2m42s
VoidBuildSystem CI / 3B · Windows Wine test (sanitizers) (push) Successful in 2m45s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 2m55s
VoidBuildSystem CI / 2C · Windows native build (relwithdebinfo) (push) Successful in 4m10s
VoidBuildSystem CI / 3C · Windows native test (debug) (push) Failing after 55s
VoidBuildSystem CI / 3C · Windows native test (sanitizers) (push) Failing after 15s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Failing after 6m29s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Failing after 6m34s
VoidBuildSystem CI / 4A · Linux package (debug) (push) Skipped
VoidBuildSystem CI / 4A · Linux package (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 4A · Linux package (sanitizers) (push) Skipped
VoidBuildSystem CI / 3C · Windows native test (relwithdebinfo) (push) Failing after 48s
VoidBuildSystem CI / 4B · Windows package (debug) (push) Successful in 1m54s
VoidBuildSystem CI / 4B · Windows package (sanitizers) (push) Successful in 16s
VoidBuildSystem CI / 4B · Windows package (relwithdebinfo) (push) Successful in 4m0s
VoidBuildSystem CI / 5 · Release (push) Skipped
chore(deps): bump VoidLibrary to de1fdcda
The new pin vendors SQLite for every platform (Sqlite is now qualified
on Windows), implements FileLock, symlink swap, reflink copy and
timestamps on Windows (Void/Library#66), so the local Win32 lock and
mtime workarounds go back to the VoidLibrary primitives, and VBS enables
Void::Sqlite unconditionally since Void resolves its own backend.

Verified: MinGW-w64 Windows build of all targets, vbs under Wine, SDK
suite 17/17 under Wine, and the Linux suite 8/8.
2026-12-06 02:30:49 +03:00

109 lines
5.2 KiB
CMake

cmake_minimum_required(VERSION 4.0)
# Captured output must be plain text: the CLI colorizes help when colors are allowed.
set(ENV{NO_COLOR} "1")
function(expect_json expected)
string(JSON actual GET "${graph}" ${ARGN})
if(NOT "${actual}" STREQUAL "${expected}")
message(FATAL_ERROR "JSON ${ARGN}: expected [${expected}], got [${actual}]")
endif()
endfunction()
foreach(profile IN ITEMS debug release)
foreach(compiler IN ITEMS gcc clang)
execute_process(COMMAND "${DESCRIBE}" --profile "${profile}" --compiler "${compiler}"
RESULT_VARIABLE code OUTPUT_VARIABLE graph ERROR_VARIABLE err TIMEOUT 10)
if(NOT "${code}" STREQUAL "0" OR NOT "${err}" STREQUAL "")
message(FATAL_ERROR "Description ${profile}/${compiler} failed: ${code}\n${err}")
endif()
expect_json(1 schema_version)
string(JSON schema_type TYPE "${graph}" schema_version)
if(NOT schema_type STREQUAL "NUMBER")
message(FATAL_ERROR "schema_version must be an integer JSON number")
endif()
expect_json("${profile}" profile name)
expect_json("${compiler}" profile compiler)
expect_json("${EXPECTED_OS}" profile os)
expect_json("${EXPECTED_ARCH}" profile architecture)
if(profile STREQUAL "debug")
expect_json(-O0 profile compile_options 0)
expect_json(-g profile compile_options 1)
else()
expect_json(-O3 profile compile_options 0)
expect_json(-DNDEBUG profile compile_options 1)
endif()
expect_json(VoidBuildSdk targets 0 name)
expect_json(static_library targets 0 kind)
expect_json(glob targets 0 sources 0 kind)
expect_json(sdk/*.cpp targets 0 sources 0 path)
expect_json(public targets 0 include_directories 0 visibility)
expect_json(VoidBuildCore targets 1 name)
expect_json(static_library targets 1 kind)
expect_json(VoidBuildSdk targets 1 links 0 target)
expect_json(public targets 1 links 0 visibility)
expect_json(VoidLibrary targets 1 links 1 dependency)
expect_json(Void::Configuration targets 1 links 1 target)
expect_json(GenerateBootstrapConfig targets 2 name)
expect_json(custom_action targets 2 kind)
expect_json(vbs targets 3 name)
expect_json(executable targets 3 kind)
expect_json(VoidBuildCore targets 3 links 0 target)
expect_json(private targets 3 links 0 visibility)
expect_json(VoidBuildRegistry targets 4 name)
expect_json(static_library targets 4 kind)
expect_json(vbs-registry targets 5 name)
expect_json(executable targets 5 kind)
expect_json(vbs_registry_tests targets 6 name)
expect_json(test targets 6 kind)
expect_json(vbs_self_smoke targets 7 name)
expect_json(test targets 7 kind)
expect_json(vbs_benchmarks targets 8 name)
expect_json(executable targets 8 kind)
expect_json(vbs_sdk_tests targets 9 name)
expect_json(test targets 9 kind)
expect_json(vbs_core_tests targets 10 name)
expect_json(test targets 10 kind)
expect_json(vbs_v1_tests targets 11 name)
expect_json(test targets 11 kind)
expect_json(vbs_selfhost_tests targets 12 name)
expect_json(test targets 12 kind)
foreach(index IN ITEMS 0 1 3 4 5 6 7 8 9 10 11 12)
if(compiler STREQUAL "gcc")
expect_json(-Wduplicated-cond targets "${index}" compile_options 2)
else()
expect_json(-Wextra-semi targets "${index}" compile_options 2)
endif()
endforeach()
expect_json(git dependencies 0 source kind)
expect_json(de1fdcda72ddd6ac069fba433b13f643327efa3f dependencies 0 source revision)
expect_json(native dependencies 0 builder)
string(JSON option_type TYPE "${graph}" dependencies 0 options BUILD_SHARED_LIBS)
if(NOT option_type STREQUAL "BOOLEAN")
message(FATAL_ERROR "CMake bool option lost its type")
endif()
endforeach()
endforeach()
execute_process(COMMAND "${DESCRIBE}" --help
RESULT_VARIABLE help_code OUTPUT_VARIABLE help_out ERROR_VARIABLE help_err TIMEOUT 10)
if(NOT "${help_code}" STREQUAL "0" OR NOT "${help_err}" STREQUAL "" OR
NOT help_out MATCHES "Usage: vbs_describe")
message(FATAL_ERROR "vbs_describe --help failed: code=${help_code}\nstdout=[${help_out}]\nstderr=[${help_err}]")
endif()
function(expect_error expected)
execute_process(COMMAND "${DESCRIBE}" ${ARGN}
RESULT_VARIABLE code OUTPUT_VARIABLE out ERROR_VARIABLE err TIMEOUT 10)
if(NOT "${code}" STREQUAL "2" OR NOT "${out}" STREQUAL "" OR
NOT "${err}" STREQUAL "vbs_describe: ${expected}\n")
message(FATAL_ERROR "Description error ${ARGN}: ${code}\nstdout=[${out}]\nstderr=[${err}]")
endif()
endfunction()
expect_error("unknown profile 'unknown'" --profile unknown)
expect_error("unknown compiler 'msvc' (expected gcc or clang)" --compiler msvc)
expect_error("option '--profile' requires a value" --profile)
expect_error("unknown option: --invalid" --invalid)
expect_error("unexpected positional argument: invalid" invalid)
message(STATUS "Four runtime profile/compiler contexts, generated help, and five error contracts verified")