diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/execute_test.cc | 14 |
1 files changed, 10 insertions, 4 deletions
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<std::string> 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<std::string> 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<std::string> vars; { |