diff options
author | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2010-10-11 23:22:52 +0100 |
---|---|---|
committer | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2010-10-11 23:29:52 +0100 |
commit | 06eafb3fccc9c2c924d796c8cab542ac2dd761c0 (patch) | |
tree | e51a369029b5dfd3046f3e72ebce31fdd96a7160 /src/test/test-child.c | |
parent | 8ecb5abbe18b4273a420479f59b907b15403a64e (diff) | |
download | tor-06eafb3fccc9c2c924d796c8cab542ac2dd761c0.tar.gz tor-06eafb3fccc9c2c924d796c8cab542ac2dd761c0.zip |
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.
Diffstat (limited to 'src/test/test-child.c')
-rw-r--r-- | src/test/test-child.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/test-child.c b/src/test/test-child.c index 100e8c0f32..ca52750c2f 100644 --- a/src/test/test-child.c +++ b/src/test/test-child.c @@ -9,7 +9,7 @@ main(int argc, char **argv) fprintf(stdout, "OUT\n"); fprintf(stderr, "ERR\n"); - for (i = 0; i < argc; i++) + for (i = 1; i < argc; i++) fprintf(stdout, "%s\n", argv[i]); fprintf(stdout, "DONE\n"); |