summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/execute_test.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/execute_test.cc b/test/execute_test.cc
new file mode 100644
index 0000000..e055757
--- /dev/null
+++ b/test/execute_test.cc
@@ -0,0 +1,23 @@
+#include <uunit.h>
+
+#include "../src/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;