From 8a1d06be63c39d8b82fb921ccc4b804ee30b6260 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Fri, 13 Feb 2026 16:03:53 -0800 Subject: [PATCH 1/3] container: root: common: add interpreter exit function Wrapper (with optional message) to underlying interpreter exit call. --- container/src/root/common/utility.hh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/container/src/root/common/utility.hh b/container/src/root/common/utility.hh index b86c6f7..90d7dee 100644 --- a/container/src/root/common/utility.hh +++ b/container/src/root/common/utility.hh @@ -276,6 +276,19 @@ int exec(const std::string& cmd) 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 //! \return timestamp in "yyyy-mm-ddThh:mm:ssZ" format //! \since docker-finance 1.0.0 From 46ae40077325db566f1fcdd953b00aa54ceac2fb Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Fri, 13 Feb 2026 16:08:57 -0800 Subject: [PATCH 2/3] container: root: test: unit: utility: add exit function no-op case --- container/src/root/test/unit/utility.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/container/src/root/test/unit/utility.hh b/container/src/root/test/unit/utility.hh index e74db59..848f75b 100644 --- a/container/src/root/test/unit/utility.hh +++ b/container/src/root/test/unit/utility.hh @@ -341,6 +341,12 @@ TEST_F(CommonFree, exec) 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) { ASSERT_EQ(common::make_timestamp().size(), 20); From 44707d9f00a2b4b42999971cccaa95b58a7f6b67 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Fri, 13 Feb 2026 16:17:33 -0800 Subject: [PATCH 3/3] repo: gitea: workflows: dfi: impl: refactor with common exit function --- .gitea/workflows/dfi.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/dfi.bash b/.gitea/workflows/dfi.bash index 4f6e5f3..46c479f 100755 --- a/.gitea/workflows/dfi.bash +++ b/.gitea/workflows/dfi.bash @@ -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 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 # # 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 # 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 }