#include "test_support.hpp" #include #include int main() { std::string marker; auto result = izo::LaunchProcess({}); CHECK(!result); CHECK(!result.errorMessage.empty()); result = izo::LaunchProcess({"/izo/missing-executable", {}, {}, false}); CHECK(!result); CHECK(!result.errorMessage.empty()); const auto directory = test_directory("process"); result = izo::LaunchProcess({"/bin/sh", {"-c", "printf launched > marker.txt"}, directory, false}); CHECK(result); CHECK(result.processId > 0); CHECK(wait_until([&] { return std::filesystem::exists(directory / "marker.txt"); })); std::ifstream(directory / "marker.txt") >> marker; CHECK(marker == "launched"); result = izo::LaunchProcess({"/bin/true", {}, directory / "missing", false}); CHECK(!result); CHECK(!result.errorMessage.empty()); std::filesystem::remove_all(directory); }