Files
CMake/Tests/RunCMake/FileAPI/configureLog-v1-check.py
Ben Boeckel a3f273b657 cmFindBase: Create find-v1 configure log events
Record `find_` command events in the configure log, except
`find_package` as it is far more complicated (and will have its own
event kind).

Note that testing only generates the events of interest, there is no
verification. Also note that testing that the "found" to "notfound"
transition causes an event is not testable because a truthy value in the
variable skips any kind of verification or other logic beyond
normalization.

Co-Authored-by: Ryan Krattiger <ryan.krattiger@kitware.com>
See: #24833
2025-04-28 13:55:36 +02:00

22 lines
777 B
Python

from check_index import *
import os
def check_objects(o):
assert is_list(o)
assert len(o) == 1
check_index_object(o[0], "configureLog", 1, 0, check_object_configureLog)
def check_object_configureLog(o):
assert sorted(o.keys()) == ["eventKindNames", "kind", "path", "version"]
# The "kind" and "version" members are handled by check_index_object.
path = o["path"]
assert matches(path, "^.*/CMakeFiles/CMakeConfigureLog\\.yaml$")
assert os.path.exists(path)
eventKindNames = o["eventKindNames"]
assert is_list(eventKindNames)
assert sorted(eventKindNames) == ["find-v1", "message-v1", "try_compile-v1", "try_run-v1"]
assert is_dict(index)
assert sorted(index.keys()) == ["cmake", "objects", "reply"]
check_objects(index["objects"])