Remove controller input for several tests

The affected tests have independent shutdown
  conditions that race with the controller inputs.
This commit is contained in:
Alexey Rybalchenko
2019-03-12 15:49:05 +01:00
committed by Dennis Klein
parent 74881d27e3
commit 1a00f3edbd
5 changed files with 67 additions and 157 deletions

View File

@@ -23,7 +23,7 @@ using namespace std;
using namespace fair::mq::test;
using namespace fair::mq::tools;
void RunSignalIn(const std::string& state, const std::string& input = "")
void RunSignalIn(const string& state, const string& control, const string& input = "")
{
size_t session{fair::mq::tools::UuidHash()};
@@ -32,7 +32,7 @@ void RunSignalIn(const std::string& state, const std::string& input = "")
stringstream cmd;
cmd << runTestDevice
<< " --id signals_" << state << "_"
<< " --control " << ((input == "") ? "static" : "interactive")
<< " --control " << control
<< " --session " << session
<< " --color false";
result = execute(cmd.str(), "[SIGINT IN " + state + "]", input);
@@ -40,110 +40,82 @@ void RunSignalIn(const std::string& state, const std::string& input = "")
device_thread.join();
ASSERT_NE(std::string::npos, result.console_out.find("raising SIGINT from " + state + "()"));
ASSERT_NE(string::npos, result.console_out.find("raising SIGINT from " + state + "()"));
exit(result.exit_code);
}
TEST(Signal_SIGINT, static_InInit)
{
EXPECT_EXIT(RunSignalIn("Init"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("Init", "static"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, static_InBind)
{
EXPECT_EXIT(RunSignalIn("Bind"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("Bind", "static"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, static_InConnect)
{
EXPECT_EXIT(RunSignalIn("Connect"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("Connect", "static"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, static_InInitTask)
{
EXPECT_EXIT(RunSignalIn("InitTask"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("InitTask", "static"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, static_InPreRun)
{
EXPECT_EXIT(RunSignalIn("PreRun"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("PreRun", "static"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, static_InRun)
{
EXPECT_EXIT(RunSignalIn("Run"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("Run", "static"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, static_InPostRun)
{
EXPECT_EXIT(RunSignalIn("PostRun"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("PostRun", "static"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, static_InResetTask)
{
EXPECT_EXIT(RunSignalIn("ResetTask"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("ResetTask", "static"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, static_InReset)
{
EXPECT_EXIT(RunSignalIn("Reset"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("Reset", "static"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_InInit)
{
EXPECT_EXIT(RunSignalIn("Init", "q"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("Init", "interactive"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_InBind)
{
EXPECT_EXIT(RunSignalIn("Bind", "q"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("Bind", "interactive"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_InConnect)
{
EXPECT_EXIT(RunSignalIn("Connect", "q"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("Connect", "interactive"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_InInitTask)
{
EXPECT_EXIT(RunSignalIn("InitTask", "q"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("InitTask", "interactive"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_InPreRun)
{
EXPECT_EXIT(RunSignalIn("PreRun", "q"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("PreRun", "interactive"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_InRun)
{
EXPECT_EXIT(RunSignalIn("Run", "q"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("Run", "interactive"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_InPostRun)
{
EXPECT_EXIT(RunSignalIn("PostRun", "q"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("PostRun", "interactive"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_InResetTask)
{
EXPECT_EXIT(RunSignalIn("ResetTask", "q"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("ResetTask", "interactive", "q"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_InReset)
{
EXPECT_EXIT(RunSignalIn("Reset", "q"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_invalid_InInit)
{
EXPECT_EXIT(RunSignalIn("Init", "_"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_invalid_InBind)
{
EXPECT_EXIT(RunSignalIn("Bind", "_"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_invalid_InConnect)
{
EXPECT_EXIT(RunSignalIn("Connect", "_"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_invalid_InInitTask)
{
EXPECT_EXIT(RunSignalIn("InitTask", "_"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_invalid_InPreRun)
{
EXPECT_EXIT(RunSignalIn("PreRun", "_"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_invalid_InRun)
{
EXPECT_EXIT(RunSignalIn("Run", "_"), ::testing::ExitedWithCode(0), "");
}
TEST(Signal_SIGINT, interactive_invalid_InPostRun)
{
EXPECT_EXIT(RunSignalIn("PostRun", "_"), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(RunSignalIn("Reset", "interactive", "q"), ::testing::ExitedWithCode(0), "");
}
} // namespace