diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-08-14 15:05:56 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-08-19 13:27:59 +0800 |
commit | d20e98b93afaf25faca4db2a3583c191bdabe439 (patch) | |
tree | 64c4575aeb756aba5206dde2b5e73f9d71655a12 /test/lib/test-process-noargs.c | |
parent | c7e26c27c7e029e6670dfebc8f27d9295e9fdeb7 (diff) | |
download | talos-petitboot-d20e98b93afaf25faca4db2a3583c191bdabe439.tar.gz talos-petitboot-d20e98b93afaf25faca4db2a3583c191bdabe439.zip |
test/lib: add process tests
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'test/lib/test-process-noargs.c')
-rw-r--r-- | test/lib/test-process-noargs.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/lib/test-process-noargs.c b/test/lib/test-process-noargs.c new file mode 100644 index 0000000..02bdc58 --- /dev/null +++ b/test/lib/test-process-noargs.c @@ -0,0 +1,30 @@ + +#include <stdlib.h> +#include <string.h> +#include <assert.h> + +#include <process/process.h> +#include <waiter/waiter.h> +#include <talloc/talloc.h> + +int main(void) +{ + struct waitset *waitset; + int result; + void *ctx; + + ctx = talloc_new(NULL); + + waitset = waitset_create(ctx); + + process_init(ctx, waitset); + + result = process_run_simple(ctx, "true", NULL); + + assert(WIFEXITED(result)); + assert(WEXITSTATUS(result) == 0); + + talloc_free(ctx); + + return EXIT_SUCCESS; +} |