Fix gctest in leak-finding mode
(a cherry-pick of commits
4e909d2,
8568ff0 from 'master')
Also, print the message about the leak-find mode just once per gctest
execution.
* tests/test.c (INIT_FIND_LEAK): Define macro.
* tests/test.c (GC_COND_INIT): Invoke INIT_FIND_LEAK.
* tests/test.c [!FIND_LEAK] (mktree): Do not call GC_REGISTER_FINALIZER
and GC_GENERAL_REGISTER_DISAPPEARING_LINK if GC_get_find_leak().
* tests/test.c (run_one_test): Replace "ifdef FIND_LEAK" with
if(GC_get_find_leak()).
* tests/test.c (run_one_test): Remove print about leak-find mode.
* tests/test.c (check_heap_stats): Do not fail on unexpected heap
growth if GC_get_find_leak().
* tests/test.c [!GC_NO_FINALIZATION] (check_heap_stats): Move
still_live and still_long_live local variables to the block of their
usage.