2 # Copyright (C) 2010, Parrot Foundation.
7 t/op/gc-leaky-call.t - test for memory leaks in the Garbage Collector
11 % prove t/op/gc-leaky-call.t
15 Tests that we actually do a GC mark and sweep after a large number of
20 .include 'interpinfo.pasm'
23 .include 'test_more.pir'
27 $S0 = interpinfo .INTERPINFO_GC_SYS_NAME
28 if $S0 == "inf" goto dont_run_hanging_tests
33 dont_run_hanging_tests:
34 ok(1, "#TODO - Test disabled on gc_inf")
35 ok(1, "#TODO - Test disabled on gc_inf")
36 ok(1, "#TODO - Test disabled on gc_inf")
40 .sub test_gc_mark_sweep
47 if counter < 1e6 goto loop
49 $I1 = interpinfo.INTERPINFO_GC_COLLECT_RUNS
50 $I2 = interpinfo.INTERPINFO_GC_MARK_RUNS
51 $I3 = interpinfo.INTERPINFO_TOTAL_MEM_ALLOC
54 $S0 = "performed " . $S1
55 $S0 .= " (which should be >=1) GC collect runs"
59 $S0 = "performed " . $S1
60 $S0 .= " (which should be >=1) GC mark runs"
64 $S0 = "allocated " . $S1
65 $S0 .= " (which should be <= 2_000_000) bytes of memory"
66 $I4 = isle $I3, 2000000
77 # vim: expandtab shiftwidth=4 ft=pir: