From 6cc2e195700e6ce02c04160c0c93af6d325d89d7 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 8 Dec 2024 11:49:43 +0100 Subject: Call execute with full settings. --- test/execute_test.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/execute_test.cc b/test/execute_test.cc index d5d40c9..4c686bf 100644 --- a/test/execute_test.cc +++ b/test/execute_test.cc @@ -23,20 +23,25 @@ public: void return_value() { + ctor::settings s; auto cur_path = std::filesystem::path(paths::argv_0).parent_path(); std::vector paths{{cur_path.string()}}; auto cmd = locate("testprog", paths); uASSERT(!cmd.empty()); - uASSERT_EQUAL(0, execute(cmd, {"retval", "0"}, {}, false)); - uASSERT_EQUAL(1, execute(cmd, {"retval", "1"}, {}, false)); - uASSERT_EQUAL(1, execute("no-such-binary", {}, {}, false)); + auto value = execute(s, cmd, {"retval", "0"}, {}, false); + uASSERT_EQUAL(0, value); + value = execute(s, cmd, {"retval", "1"}, {}, false); + uASSERT_EQUAL(1, value); + value = execute(s, "no-such-binary", {}, {}, false); + uASSERT_EQUAL(1, value); } void env() { using namespace std::string_literals; + ctor::settings s; auto cur_path = std::filesystem::path(paths::argv_0).parent_path(); std::vector paths{{cur_path.string()}}; auto cmd = locate("testprog", paths); @@ -53,7 +58,8 @@ public: // Overwrite the exiting LANG var env["LANG"] = "foo"; - uASSERT_EQUAL(0, execute(cmd, {"envdump", tmp.get()}, env, false)); + auto value = execute(s, cmd, {"envdump", tmp.get()}, env, false); + uASSERT_EQUAL(0, value); std::vector vars; { -- cgit v1.2.3