diff options
author | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2010-10-10 18:12:23 +0100 |
---|---|---|
committer | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2010-10-10 19:08:44 +0100 |
commit | 8a12ce2cf9bb6362e380e7efaee334d82cc3c7c8 (patch) | |
tree | 4599c8392a4308011625a7ccfe19e21466c342ba /src/test/test-child.c | |
parent | 68e576e9f92e94e27123d47ce27c56426eb06193 (diff) | |
download | tor-8a12ce2cf9bb6362e380e7efaee334d82cc3c7c8.tar.gz tor-8a12ce2cf9bb6362e380e7efaee334d82cc3c7c8.zip |
Add a unit test for tor_spawn_background
- Test sucessfully starting a process
- Test failing to find the executable
Diffstat (limited to 'src/test/test-child.c')
-rw-r--r-- | src/test/test-child.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/test-child.c b/src/test/test-child.c new file mode 100644 index 0000000000..100e8c0f32 --- /dev/null +++ b/src/test/test-child.c @@ -0,0 +1,18 @@ +#include <stdio.h> + +/** Trivial test program which prints out its command line arguments so we can + * check if tor_spawn_background() works */ +int +main(int argc, char **argv) +{ + int i; + + fprintf(stdout, "OUT\n"); + fprintf(stderr, "ERR\n"); + for (i = 0; i < argc; i++) + fprintf(stdout, "%s\n", argv[i]); + fprintf(stdout, "DONE\n"); + + return 0; +} + |