1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#include <uunit.h> #include <execute.h> class ExecuteTest : public uUnit { public: ExecuteTest() { uTEST(ExecuteTest::runit); } void runit() { uASSERT_EQUAL(0, execute("/bin/true", {}, false)); uASSERT_EQUAL(1, execute("/bin/false", {}, false)); uASSERT_EQUAL(1, execute("no-such-binary", {}, false)); } }; // Registers the fixture into the 'registry' static ExecuteTest test;