tor/src/test/test-child.c
Steven Murdoch 06eafb3fcc Fix running unit tests from outside of the build directory (fixes bug #2051)
Currently the unit tests test_util_spawn_background_* assume that they
are run from the Tor build directory. This is not the case when running
make distcheck, so the test will fail. This problem is fixed by autoconf
setting BUILDDIR to be the root of the Tor build directory, and this
preprocessor variable being used to specify the absolute path to
test-child. Also, in test-child, do not print out argv[0] because this will
no longer be predictable. Found by Sebastian Hahn.
2010-10-11 23:29:52 +01:00

19 lines
355 B
C

#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 = 1; i < argc; i++)
fprintf(stdout, "%s\n", argv[i]);
fprintf(stdout, "DONE\n");
return 0;
}