summaryrefslogtreecommitdiff
path: root/test/execute_test.cc
blob: e055757adcac4549d9c0a27743dba3707211c298 (plain)
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 "../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;