]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/profiler/sampling/sampling-tests.factor
factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool!
[factor.git] / basis / tools / profiler / sampling / sampling-tests.factor
1 USING: byte-arrays calendar kernel math memory namespaces
2 random threads tools.profiler.sampling
3 tools.profiler.sampling.private tools.test sequences ;
4 IN: tools.profiler.sampling.tests
5
6 ! Make sure the profiler doesn't blow up the VM
7 TUPLE: boom ;
8 { } [ 10 [ [ ] profile ] times ] unit-test
9 [ 10 [ [ boom new throw ] profile ] times ] [ boom? ] must-fail-with
10 { } [ 10 [ [ 100 [ 1000 random (byte-array) drop ] times gc ] profile ] times ] unit-test
11 { } [ 10 [ [ 100 [ 1000 random (byte-array) drop ] times compact-gc ] profile ] times ] unit-test
12 { } [ 2 [ [ 1 seconds sleep ] profile ] times ] unit-test
13
14 { } [ [ 300,000 iota [ sq sq sq ] map drop ] profile flat profile. ] unit-test
15 { } [ [ 300,000 iota [ sq sq sq ] map drop ] profile top-down profile. ] unit-test
16
17 (clear-samples)
18 f raw-profile-data set-global
19 gc