diff --git a/basis/tools/profiler/sampling/sampling-tests.factor b/basis/tools/profiler/sampling/sampling-tests.factor index 9cd91beef86..6493f3c9bdc 100644 --- a/basis/tools/profiler/sampling/sampling-tests.factor +++ b/basis/tools/profiler/sampling/sampling-tests.factor @@ -1,6 +1,7 @@ -USING: assocs byte-arrays calendar kernel kernel.private math memory -namespaces parser random sequences threads tools.profiler.sampling -tools.profiler.sampling.private tools.test ; +USING: assocs byte-arrays calendar kernel kernel.private math +memory namespaces parser random sequences threads +tools.profiler.sampling tools.profiler.sampling.private +tools.test ; IN: tools.profiler.sampling.tests ! collect-tops: top is the last element in the array @@ -13,12 +14,34 @@ IN: tools.profiler.sampling.tests TUPLE: boom ; { } [ 10 [ [ ] profile ] times ] unit-test [ 10 [ [ boom new throw ] profile ] times ] [ boom? ] must-fail-with -{ } [ 10 [ [ 100 [ 1000 random (byte-array) drop ] times gc ] profile ] times ] unit-test -{ } [ 10 [ [ 100 [ 1000 random (byte-array) drop ] times compact-gc ] profile ] times ] unit-test -{ } [ 2 [ [ 1 seconds sleep ] profile ] times ] unit-test -{ } [ [ 1,000,000 [ sq sq sq ] map drop ] profile flat profile. ] unit-test -{ } [ [ 1,000,000 [ sq sq sq ] map drop ] profile top-down profile. ] unit-test +{ t t t t t t t t t t } [ + 10 [ + [ + 100 [ 1000 random (byte-array) >boolean t assert= ] times gc + ] profile raw-profile-data get-global >boolean + ] times +] unit-test + +{ t t t t t t t t t t } [ + 10 [ + [ + 100 [ 1000 random (byte-array) >boolean t assert= ] times compact-gc + ] profile raw-profile-data get-global >boolean + ] times +] unit-test + +{ t t } [ + 2 [ + [ 1 seconds sleep ] profile + raw-profile-data get-global >boolean + ] times +] unit-test + +{ t } [ + [ 1,000,000 [ sq sq sq ] map >boolean t assert= ] profile + raw-profile-data get-global >boolean +] unit-test f raw-profile-data set-global gc