Merge pull request #298 into master
All checks were successful
docker-finance / all (push) Successful in 31m46s
All checks were successful
docker-finance / all (push) Successful in 31m46s
44707d9frepo: gitea: workflows: dfi: impl: refactor with common exit function (Aaron Fiore)46ae4007container: root: test: unit: utility: add exit function no-op case (Aaron Fiore)8a1d06becontainer: root: common: add interpreter exit function (Aaron Fiore)
This commit was merged in pull request #298.
This commit is contained in:
@@ -702,18 +702,18 @@ function container::finance::root()
|
|||||||
"${ci_shell[@]}" "$_exec '$_root macros/repo/test/unit.C' $_exit"
|
"${ci_shell[@]}" "$_exec '$_root macros/repo/test/unit.C' $_exit"
|
||||||
"${ci_shell[@]}" "$_exec '$_root macros/repo/test/unit.C Pluggable\*:Macro\*:Plugin\*' $_exit"
|
"${ci_shell[@]}" "$_exec '$_root macros/repo/test/unit.C Pluggable\*:Macro\*:Plugin\*' $_exit"
|
||||||
|
|
||||||
"${ci_shell[@]}" "$_exec '$_root macros/repo/web/server.C gSystem-\>Exit\(0\)\;'"
|
"${ci_shell[@]}" "$_exec '$_root macros/repo/web/server.C dfi::common::exit\(0,\\\\\\\"Server\\\\\\\"\)\;'"
|
||||||
# TODO: ^ return value of macro
|
# TODO: ^ return value of macro
|
||||||
|
|
||||||
#
|
#
|
||||||
# Plugins
|
# Plugins
|
||||||
#
|
#
|
||||||
|
|
||||||
"${ci_shell[@]}" "$_exec '$_root plugins/repo/example/example.cc dfi::plugin::example::MyExamples\\ my\;my.example1\(\)\;gSystem-\>Exit\(0\)\;'"
|
"${ci_shell[@]}" "$_exec '$_root plugins/repo/example/example.cc dfi::plugin::example::MyExamples\\ my\;my.example1\(\)\;dfi::common::exit\(0,\\\\\\\"MyExamples\\\\\\\"\)\;'"
|
||||||
|
|
||||||
# WARNING: bitcoin plugin requires dfi client-side bitcoin plugin
|
# WARNING: bitcoin plugin requires dfi client-side bitcoin plugin
|
||||||
# and must run *AFTER* the above client::finance::plugins() test
|
# and must run *AFTER* the above client::finance::plugins() test
|
||||||
"${ci_shell[@]}" "$_exec '$_root plugins/repo/bitcoin/bitcoin.cc try{dfi::macro::load\(\\\\\\\"repo/test/unit.C\\\\\\\"\)\;}catch\(...\){gSystem-\>Exit\(1\)\;}gSystem-\>Exit\(0\)\;' $_exit"
|
"${ci_shell[@]}" "$_exec '$_root plugins/repo/bitcoin/bitcoin.cc try{dfi::macro::load\(\\\\\\\"repo/test/unit.C\\\\\\\"\)\;}catch\(...\){dfi::common::exit\(1\)\;}dfi::common::exit\(0\)\;' $_exit"
|
||||||
client::finance::down
|
client::finance::down
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -276,6 +276,19 @@ int exec(const std::string& cmd)
|
|||||||
return gSystem->Exec(cmd.c_str());
|
return gSystem->Exec(cmd.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! \brief Exit the interpreter with given status (and message)
|
||||||
|
//! \param code Exit code status (return code)
|
||||||
|
//! \param message Optional exit message
|
||||||
|
//! \since docker-finance 1.2.0
|
||||||
|
void exit(const int code, const std::string& message = {})
|
||||||
|
{
|
||||||
|
// TODO(unassigned): logger
|
||||||
|
if (!message.empty())
|
||||||
|
std::cout << "Exiting: '" << message << "'" << std::endl;
|
||||||
|
|
||||||
|
gSystem->Exit(code);
|
||||||
|
}
|
||||||
|
|
||||||
//! \brief Make current timestamp
|
//! \brief Make current timestamp
|
||||||
//! \return timestamp in "yyyy-mm-ddThh:mm:ssZ" format
|
//! \return timestamp in "yyyy-mm-ddThh:mm:ssZ" format
|
||||||
//! \since docker-finance 1.0.0
|
//! \since docker-finance 1.0.0
|
||||||
|
|||||||
@@ -341,6 +341,12 @@ TEST_F(CommonFree, exec)
|
|||||||
ASSERT_EQ(common::exec("pwd"), 0);
|
ASSERT_EQ(common::exec("pwd"), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(CommonFree, exit)
|
||||||
|
{
|
||||||
|
// NOTE: no-op (or else entire framework exits).
|
||||||
|
// Execution is covered in functional tests (gitea workflow).
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(CommonFree, make_timestamp)
|
TEST_F(CommonFree, make_timestamp)
|
||||||
{
|
{
|
||||||
ASSERT_EQ(common::make_timestamp().size(), 20);
|
ASSERT_EQ(common::make_timestamp().size(), 20);
|
||||||
|
|||||||
Reference in New Issue
Block a user