aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/unit_tests/process.cpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-10-24 21:33:44 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-10-27 00:11:41 +0300
commita864099ba77157090c4cd12817245122c163ec24 (patch)
treef15b1f2801219fa9af6111fa28591858d87711ec /test/unit_tests/process.cpp
parentProcess: add termination methods (diff)
downloadwinapi-common-a864099ba77157090c4cd12817245122c163ec24.tar.gz
winapi-common-a864099ba77157090c4cd12817245122c163ec24.zip
rework Process API & tests
* Add separate classes ProcessParameters & ShellParameters for Process::create() and Process::shell() methods. * Add a separate "worker" executable. It's used in tests via a fairly complicated scheme, receiving orders to execute via a shared memory region. * Add tests that utilize the Console API, reading console window's screen buffer directly, making for more reliable tests & broader coverage.
Diffstat (limited to 'test/unit_tests/process.cpp')
-rw-r--r--test/unit_tests/process.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/unit_tests/process.cpp b/test/unit_tests/process.cpp
index cfc50f4..a048c84 100644
--- a/test/unit_tests/process.cpp
+++ b/test/unit_tests/process.cpp
@@ -86,7 +86,8 @@ BOOST_FIXTURE_TEST_CASE(echo_stdin_from_file, WithEchoExe) {
BOOST_FIXTURE_TEST_CASE(echo_runas, WithEchoExe) {
const CommandLine cmd_line{get_echo_exe(), {"foo", "bar"}};
- const auto process = Process::runas(cmd_line);
+ const auto params = ShellParameters::runas(cmd_line);
+ const auto process = Process::shell(params);
process.wait();
BOOST_TEST(process.get_exit_code() == 0);
}