feat(daemon): FireEvent + event name resolution + in-process gRPC tests

- name_index: add resolve_event(name) -> CEID (unit-tested).
- equipment_service.hpp: extract the gRPC service + value/state conversion
  into a shared header; add FireEvent (optional per-fire variable values,
  then trigger the collection event by name). secs_gemd slims to main().
- test_daemon_service: real in-process gRPC integration test (client stub ->
  service -> EquipmentRuntime) proving SetVariables lands in the model,
  GetControlState reports the state, FireEvent and unknown-name paths behave.
  Separate secs_gemd_tests target (links grpc++/proto), gated on the daemon.

Core suite 459/459 (2799 assertions); daemon gRPC tests 15/15.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-10 18:07:12 +02:00
parent fc898f8410
commit cb85199f49
6 changed files with 230 additions and 64 deletions
+17
View File
@@ -170,6 +170,7 @@ if(SECSGEM_DAEMON)
${PROTO_OUT}/secsgem/v1/equipment.grpc.pb.cc)
target_include_directories(secs_gemd PRIVATE ${PROTO_OUT} ${Protobuf_INCLUDE_DIRS})
target_link_libraries(secs_gemd PRIVATE secsgem PkgConfig::GRPCPP ${Protobuf_LIBRARIES})
set(SECSGEM_DAEMON_BUILT TRUE)
message(STATUS "secs_gemd daemon enabled (grpc++ ${GRPCPP_VERSION})")
else()
message(STATUS "secs_gemd skipped (need protobuf + grpc++ + grpc_cpp_plugin)")
@@ -258,3 +259,19 @@ target_link_libraries(secsgem_tests PRIVATE secsgem doctest::doctest)
target_compile_definitions(secsgem_tests PRIVATE
SECSGEM_DATA_DIR="${CMAKE_SOURCE_DIR}/data")
add_test(NAME secsgem_tests COMMAND secsgem_tests)
# Daemon gRPC integration tests (separate binary: needs grpc++ + the generated
# proto, which the core test binary doesn't link). Built only when the daemon is.
if(SECSGEM_DAEMON_BUILT)
add_executable(secs_gemd_tests
tests/test_daemon_service.cpp
${PROTO_OUT}/secsgem/v1/equipment.pb.cc
${PROTO_OUT}/secsgem/v1/equipment.grpc.pb.cc)
target_include_directories(secs_gemd_tests PRIVATE
${PROTO_OUT} ${Protobuf_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/apps)
target_link_libraries(secs_gemd_tests PRIVATE
secsgem PkgConfig::GRPCPP ${Protobuf_LIBRARIES} doctest::doctest)
target_compile_definitions(secs_gemd_tests PRIVATE
SECSGEM_DATA_DIR="${CMAKE_SOURCE_DIR}/data")
add_test(NAME secs_gemd_tests COMMAND secs_gemd_tests)
endif()