Files
Library/tests/package/RuntimeOnly/main.cpp
T

30 lines
920 B
C++

#include <Void/Async/Executor.hpp>
#include <Void/IO/Driver.hpp>
#include <Void/Runtime/Host.hpp>
#include <Void/Time/Clock.hpp>
int main()
{
auto host = Void::Runtime::Host::create();
if (!host.has_value() ||
host->state() != Void::Runtime::HostState::constructed ||
host->started_worker_count() != 0) {
return 1;
}
Void::Async::ManualExecutor exec;
Void::Time::ManualClock clock;
auto drv = Void::IO::Driver::create(
exec, Void::IO::BackendOptions{.preference = Void::IO::BackendPreference::mock}, clock);
if (!drv.has_value()) {
return 1;
}
auto emb = Void::Runtime::Host::create_embedded(
Void::Runtime::Options{},
Void::Runtime::EmbeddedResources{
.executor = &exec,
.io = drv->get(),
.clock = &clock,
});
return (emb.has_value() && emb->options().embedded_mode) ? 0 : 1;
}