mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 13:11:36 +00:00
- Add test::StateParam (state, control mode, stdin input) and WithControls() for INSTANTIATE_TEST_SUITE_P() - Turn the 60 TEST() copies in the Exceptions, ErrorState, Signals and WaitFor files into one TEST_P() each - The test names change, e.g. Exceptions.interactive_InRun is now Exceptions.Throw/interactive_Run, Signal_SIGINT.* is Signals.RaiseSIGINT/* and ErrorState.OrphanMessages is OrphanMessages.shmem Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.2 KiB
C++
38 lines
1.2 KiB
C++
/********************************************************************************
|
|
* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
|
* *
|
|
* This software is distributed under the terms of the *
|
|
* GNU Lesser General Public Licence (LGPL) version 3, *
|
|
* copied verbatim in the file "LICENSE" *
|
|
********************************************************************************/
|
|
|
|
#include <helper/Devices.h>
|
|
#include <helper/StateParam.h>
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
#include <string>
|
|
|
|
namespace
|
|
{
|
|
|
|
using namespace std;
|
|
using namespace fair::mq::test;
|
|
|
|
using Signals = StateTest;
|
|
|
|
TEST_P(Signals, RaiseSIGINT)
|
|
{
|
|
auto const& state = GetParam().state;
|
|
RunOptions options;
|
|
options.control = GetParam().control;
|
|
options.input = GetParam().Input();
|
|
auto const results = RunDevices({{"signals_" + state + "_"}}, options);
|
|
|
|
EXPECT_TRUE(ExitedWith(results.at(0), 0, "raising SIGINT from " + state + "()"));
|
|
}
|
|
|
|
INSTANTIATE_TEST_SUITE_P(, Signals, WithControls(HookStates()), StateParamName());
|
|
|
|
} // namespace
|