diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-12-08 11:49:43 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-12-08 12:13:37 +0100 |
commit | 6cc2e195700e6ce02c04160c0c93af6d325d89d7 (patch) | |
tree | 87f76acebf73498d0fab528e043ea84ca1f8b863 /test/execute_test.cc | |
parent | 87997f6285fdba420c00e740d26f98f7e7e06504 (diff) |
Call execute with full settings.execute_with_env
Diffstat (limited to 'test/execute_test.cc')
-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; { |