WIP: tests
This commit is contained in:
parent
f76f911c98
commit
01488c71df
@ -2,13 +2,34 @@
|
||||
#include <uvw.hpp>
|
||||
|
||||
|
||||
TEST(Process, Pid) {
|
||||
auto loop = uvw::Loop::getDefault();
|
||||
auto handle = loop->resource<uvw::ProcessHandle>();
|
||||
|
||||
ASSERT_EQ(handle->pid(), 0);
|
||||
|
||||
loop->run();
|
||||
}
|
||||
|
||||
|
||||
TEST(Process, Cwd) {
|
||||
auto loop = uvw::Loop::getDefault();
|
||||
auto handle = loop->resource<uvw::ProcessHandle>();
|
||||
|
||||
handle->cwd(".");
|
||||
|
||||
loop->run();
|
||||
}
|
||||
|
||||
|
||||
TEST(Process, StdIO) {
|
||||
auto loop = uvw::Loop::getDefault();
|
||||
auto handle = loop->resource<uvw::ProcessHandle>();
|
||||
auto pipe = loop->resource<uvw::PipeHandle>();
|
||||
|
||||
uvw::ProcessHandle::disableStdIOInheritance();
|
||||
handle->stdio(*pipe, uvw::Flags<uvw::ProcessHandle::StdIO>::from<uvw::ProcessHandle::StdIO::CREATE_PIPE, uvw::ProcessHandle::StdIO::READABLE_PIPE>());
|
||||
handle->stdio(uvw::StdIN, uvw::ProcessHandle::StdIO::READABLE_PIPE);
|
||||
handle->stdio(uvw::StdIN, uvw::ProcessHandle::StdIO::IGNORE_STREAM);
|
||||
|
||||
pipe->close();
|
||||
loop->run();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user