- 30 Nov, 2011 2 commits
-
-
Rusty Russell authored
This gives a much deeper insight into what failtest is doing; good for debugging failtest itself.
-
Rusty Russell authored
We currently save all files in the parent, and restore them once the child is gone. That doesn't work in a case where the child manipulates a file the parent doesn't currently have open, so switch to a model where the child cleans itself up, using the already-existing cleanup callbacks. This means that we need to undo much more, especially restoring file offsets. We also need to handle the case where we've already closed the file, and now we're cleaning up. As a bonus, we now handle open() with O_TRUNC properly. The cleanup function now has two modes: one simply frees (so valgrind doesn't complain about failtest leaking so the user can see real leaks in their programs), the other restores things so the parent sees no changes.
-
- 29 Nov, 2011 20 commits
-
-
Rusty Russell authored
-
Rusty Russell authored
The argument is wrong, so the return was -1. That currently works, but it will beak with the next patch. Fix the typo.
-
Rusty Russell authored
And separate out the code which follows --failpath so failtest_close() can use it too.
-
Rusty Russell authored
It was the wrong way around, and also it's better to show the whole remaining failpath rather than the current letter.
-
Rusty Russell authored
Don't continue when we report a leak: tell the parent it's a failure.
-
Rusty Russell authored
Now we test failing mmap, ccanlint -v time has increased from 200 to 330 seconds. Worse, tests no time out on my laptop. Fix this, by preventing us from going down that particular rabbit hole. ccanlint -v now takes 201 seconds again.
-
Rusty Russell authored
mmap can also fail on out-of-memory, and for the coming change to the way we save and restore files we want to know about them anyway.
-
Rusty Russell authored
failtest now culls duplicates for itself (and more efficiently), so don't replicate the logic here. It changes things a bit, because failtest uses backtraces rather than a simple call point to find duplicates. Also, fix one case (in run-11-simple-fetch.c) where we simply exited rather than using failtest_exit(). We got away with it before, because we never hit that particular failure pattern.
-
Rusty Russell authored
Calling failpath_string() here leaves the final letter randomly upper or lower-cased, since call->fail is uninitialized. This means we sometimes don't match the debug string. 1) Initialize call->fail here so it will match the debug string. 2) If our calls don't match --debugpath, abort. 3) Don't match the final letter (which may be upper or lower case) when checking we're still on the path. We could do better, but this is only a sanity-check anyway.
-
Rusty Russell authored
If we can get a backtrace, we can automatically eliminate identical failures. Surprisingly backtrace() is quite fast, but the savings for the (naively-written) rbtree tests are impressive. ccanlint -v time drops from 43 seconds to 6 seconds.
-
Rusty Russell authored
-
Rusty Russell authored
When a failtest_hook returns fail_probe(), we start a counter to continue for a little way. Replace this hack with a simple flag, which disables further failures. Interestingly, this doesn't reduce coverage on the current modules which use failtest.
-
Rusty Russell authored
This is useful for debugging failtest itself, as well as for things like tracing.
-
Rusty Russell authored
We use file descriptors inside failtest; use dup2 to try to avoid changing the file descriptor numbers used in the program (particularly when programs mess with invalid file descriptors, they're likely to still be invalid).
-
Rusty Russell authored
This avoids a silly realloc, but more importantly it gets us closer to being runtime extensible, as each history element can be a different size.
-
Rusty Russell authored
-
Rusty Russell authored
-
Rusty Russell authored
Less cut & paste means less patching as failtest changes.
-
Rusty Russell authored
failtest_malloc should use p->u.malloc not p->u.calloc. The layouts are identical, so it doesn't matter, but it's confusing and leaves us open to weird bugs in future should one change.
-
Rusty Russell authored
This depends on reduce_features; currently it tends to run before that, so it doesn't think there are any features to reduce and doesn't build or run the tests with reduced features.
-
- 23 Nov, 2011 2 commits
-
-
Rusty Russell authored
Saves me doing it manually.
-
Vladimir Zapolskiy authored
This change initializes a counter of children, otherwise is may contain arbitrary value. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
-
- 21 Nov, 2011 2 commits
-
-
Rusty Russell authored
As noted by Jan Engelhardt; libHX fixed this already.
-
Rusty Russell authored
The two tests are identical with one line different, so make it clear.
-
- 16 Nov, 2011 1 commit
-
-
Rusty Russell authored
Broken by 758ab1f4 "ccanlint: drop -d, interpret any arguments as directories, and allow multiple."
-
- 15 Nov, 2011 2 commits
-
-
Rusty Russell authored
Compulsory means "malformed", we might get rid of it altogether, since any test can mark "fail" and make ccanlint exit with non-zero status. Now we only have four compulsory tests: info_exists Module has _info file depends_exist Module's CCAN dependencies can be found objects_build Module object files can be built module_builds Module can be built from object files
-
Rusty Russell authored
-
- 01 Nov, 2011 5 commits
-
-
Rusty Russell authored
We currently insist that a tdb file be a version1 file if tdb_open() is passed the TDB_VERSION1 flag; we fail if it's actually a tdb2. But that makes generic wrappers harder, and is unlikely to be what the user wants: if they do, they can check tdb_get_flags() & TDB_VERSION1 after opening.
-
Rusty Russell authored
It seems redundant: strset_test() and strset_clear() can only return NULL when the string is not a member. However, it became clear in writing ccan/tsort that it's much more convenient for callers if we set errno in this case too, so they can pass it up.
-
Rusty Russell authored
It seems redundant: strmap_get() and strmap_del() can only return NULL when the string is not a member. However, it became clear in writing ccan/tsort that it's much more convenient for callers if we set errno in this case too, so they can pass it up.
-
Rusty Russell authored
We weren't initializing the leak_info field when the test was marked FAIL in _info (as in tdb2).
-
Rusty Russell authored
Fallout from commit 758ab1f4 (ccanlint: drop -d, interpret any arguments as directories...)
-
- 26 Oct, 2011 3 commits
-
-
Rusty Russell authored
Actually, I don't even think it means that. But rename it to something which is sane. Thanks to David Gibson for reporting.
-
Rusty Russell authored
-
Rusty Russell authored
-
- 24 Oct, 2011 1 commit
-
-
Rusty Russell authored
Hasn't worked for a while now. Oops.
-
- 05 Oct, 2011 2 commits
-
-
Rusty Russell authored
This gets us closer to 'ccanlint *' rather than relying on Makefiles to test all modules. Unfortunately, because of limited parallelism, it's currently slower than make -j.
-
Rusty Russell authored
Because we fork children to do compilations, and we use stdio, we need to flush stdout before the fork otherwise the child will flush afterwards. The compile tests interpret this output as a compiler warning. This shows up if you redirect ccanlint output to a file.
-