diff --git a/rosella.c b/rosella.c index 78c9abd..5f03a62 100644 --- a/rosella.c +++ b/rosella.c @@ -14,7 +14,7 @@ static void test_builtins(void); static void test_weak_boxes_and_wills(void); -static void test_garbage_collection(void); +static void test_garbage_collection(bool keep_going); static void print_value(value_t v); static void print_gc_stats(void); @@ -39,7 +39,7 @@ int main(int argc, char **argv) test_builtins(); test_weak_boxes_and_wills(); - test_garbage_collection(); + test_garbage_collection(argc > 1); return 0; } @@ -88,7 +88,7 @@ static void test_weak_boxes_and_wills(void) unregister_gc_root(&tmp_root); } -static void test_garbage_collection(void) +static void test_garbage_collection(bool keep_going) { gc_root_t root; int count = 0; @@ -143,7 +143,8 @@ static void test_garbage_collection(void) gc_stats.max_ns = 0; count = 0; - break; + if (!keep_going) + break; } }