cb85199f49
- 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>
34 lines
1.2 KiB
C++
34 lines
1.2 KiB
C++
#include <doctest/doctest.h>
|
|
|
|
#include "secsgem/config/loader.hpp"
|
|
#include "secsgem/gem/name_index.hpp"
|
|
|
|
using namespace secsgem;
|
|
namespace gem = secsgem::gem;
|
|
|
|
#ifndef SECSGEM_DATA_DIR
|
|
#error "SECSGEM_DATA_DIR not defined; see CMakeLists.txt"
|
|
#endif
|
|
|
|
TEST_CASE("resolve_variable maps config names to VIDs across SVIDs and DVIDs") {
|
|
gem::EquipmentDataModel m;
|
|
config::load_equipment(SECSGEM_DATA_DIR "/equipment.yaml", m);
|
|
|
|
CHECK(gem::resolve_variable(m, "ControlState") == 1); // SVID
|
|
CHECK(gem::resolve_variable(m, "Clock") == 2); // SVID
|
|
CHECK(gem::resolve_variable(m, "WaferCounter") == 100); // DVID
|
|
CHECK(gem::resolve_variable(m, "ChamberPressure") == 101);// DVID
|
|
CHECK_FALSE(gem::resolve_variable(m, "nonexistent").has_value());
|
|
CHECK_FALSE(gem::resolve_variable(m, "").has_value());
|
|
}
|
|
|
|
TEST_CASE("resolve_event maps collection-event names to CEIDs") {
|
|
gem::EquipmentDataModel m;
|
|
config::load_equipment(SECSGEM_DATA_DIR "/equipment.yaml", m);
|
|
|
|
CHECK(gem::resolve_event(m, "ControlStateChanged") == 100);
|
|
CHECK(gem::resolve_event(m, "ProcessStarted") == 300);
|
|
CHECK(gem::resolve_event(m, "ControlJobCompleted") == 401);
|
|
CHECK_FALSE(gem::resolve_event(m, "nonexistent").has_value());
|
|
}
|