]> gitweb.factorcode.org Git - factor.git/blob - extra/tools/profiler/profiler-tests.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / extra / tools / profiler / profiler-tests.factor
1 IN: tools.profiler.tests
2 USING: tools.profiler tools.test kernel memory math threads
3 alien tools.profiler.private sequences ;
4
5 [ t ] [
6     \ length profile-counter
7     10 [ { } length drop ] times
8     \ length profile-counter =
9 ] unit-test
10
11 [ ] [ [ 10 [ gc ] times ] profile ] unit-test
12
13 [ ] [ [ 1000 sleep ] profile ] unit-test 
14
15 [ ] [ profile. ] unit-test
16
17 [ ] [ vocabs-profile. ] unit-test
18
19 [ ] [ "kernel.private" vocab-profile. ] unit-test
20
21 [ ] [ \ + usage-profile. ] unit-test
22
23 : callback-test "void" { } "cdecl" [ ] alien-callback ;
24
25 : indirect-test "void" { } "cdecl" alien-indirect ;
26
27 : foobar ;
28
29 [
30     [ ] [ callback-test indirect-test ] unit-test
31     foobar
32 ] profile
33
34 [ 1 ] [ \ foobar profile-counter ] unit-test
35
36 : fooblah { } [ ] each ;
37
38 : foobaz fooblah fooblah ;
39
40 [ foobaz ] profile
41
42 [ 1 ] [ \ foobaz profile-counter ] unit-test
43
44 [ 2 ] [ \ fooblah profile-counter ] unit-test