refactor(test): merge the state action test devices

- Replace TestExceptions, TestErrorState, TestSignals and TestWaitFor
  with one StateAction device; the id selects the action and the state
- Run the device tests through test::RunDevices() instead of
  EXPECT_EXIT() and check the exit code and the expected log line

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-11-03 14:27:49 +00:00
committed by Dennis Klein
parent be400e4752
commit 2a57a38efe
11 changed files with 224 additions and 477 deletions

View File

@@ -17,11 +17,8 @@
#include "devices/TestRep.h"
#include "devices/TestReq.h"
#include "devices/TestSub.h"
#include "devices/TestStateAction.h"
#include "devices/TestTransferTimeout.h"
#include "devices/TestWaitFor.h"
#include "devices/TestExceptions.h"
#include "devices/TestErrorState.h"
#include "devices/TestSignals.h"
#include <fairmq/runDevice.h>
@@ -70,14 +67,8 @@ auto getDevice(fair::mq::ProgOptions& config) -> std::unique_ptr<fair::mq::Devic
return std::make_unique<PairLeft>();
} else if (0 == id.find("pairright_")) {
return std::make_unique<PairRight>();
} else if (0 == id.find("waitfor_")) {
return std::make_unique<TestWaitFor>();
} else if (0 == id.find("exceptions_")) {
return std::make_unique<Exceptions>();
} else if (0 == id.find("error_state_")) {
return std::make_unique<ErrorState>();
} else if (0 == id.find("signals_")) {
return std::make_unique<Signals>();
} else if (0 == id.find("exceptions_") || 0 == id.find("error_state_") || 0 == id.find("signals_") || 0 == id.find("waitfor_")) {
return std::make_unique<StateAction>();
} else {
cerr << "Don't know id '" << id << "'" << endl;
return nullptr;