tests: add output for benchs that does not have some
authorJean Privat <jean@pryen.org>
Fri, 17 Apr 2015 08:11:02 +0000 (15:11 +0700)
committerJean Privat <jean@pryen.org>
Fri, 17 Apr 2015 08:11:18 +0000 (15:11 +0700)
Signed-off-by: Jean Privat <jean@pryen.org>

tests/bench_complex_sort.nit
tests/bench_send.nit
tests/bench_send2.nit
tests/sav/bench_complex_sort.res [new file with mode: 0644]
tests/sav/bench_send.res [new file with mode: 0644]
tests/sav/bench_send2.res [new file with mode: 0644]

index e05cb45..5d96859 100644 (file)
@@ -26,6 +26,7 @@ class A
        redef fun val1: Int do return _a
 
        init(i: Int) do _a = i
+       redef fun to_s do return "Aa{a}"
 end
 
 class Elt2
@@ -39,6 +40,7 @@ end
 class B
        super Elt2
        init(i: Int) do initelt2(i)
+       redef fun to_s do return "Bb{b}"
 end
 
 class C
@@ -52,6 +54,7 @@ class C
                _c = i
                _d = j
        end
+       redef fun to_s do return "Cc{c}d{d}"
 end
 
 class D
@@ -64,6 +67,7 @@ class D
                init(i)
                initelt2(j)
        end
+       redef fun to_s do return "Da{a}b{b}"
 end
 
 class E
@@ -71,6 +75,7 @@ class E
        redef fun val1: Int do return 5 end
 
        init(i: Int) do initelt2(i)
+       redef fun to_s do return "Eb{b}"
 end
 
 class EltComparator
@@ -111,6 +116,7 @@ do
        end
 end
 
+srand_from(0)
 var n = 20
 
 if not args.is_empty then
@@ -122,9 +128,12 @@ for i in [0..n[ do
        array.push(generator)
 end
 
+print array.join(", ")
+
 var comparator = new EltComparator
 for i in [0..n[ do
        comparator.sort(array)
        comparator.toggle
 end
 
+print array.join(", ")
index 5659ee1..d3c1b7c 100644 (file)
@@ -44,8 +44,11 @@ class A
        end
        fun baz
        do
+               i += 1
        end
 
+       var i = 0
+
        init
        do
        end
@@ -105,3 +108,8 @@ while i < 1.lshift(n) do
        a.hop(b, c, d)
        i = i + 1
 end
+
+print a.i
+print b.i
+print c.i
+print d.i
index 3e8853e..a4f53ad 100644 (file)
@@ -18,8 +18,9 @@ redef class Object
        fun foo do end
 end
 class A
-       redef fun foo do end
+       redef fun foo do i += 1 end
        init do end
+       var i = 0
 end
 class B
        super A
@@ -72,3 +73,6 @@ for i in [0..1.lshift(n)[ do
        end
 end
 
+for j in [0..nb[ do
+       print a[j].as(A).i
+end
diff --git a/tests/sav/bench_complex_sort.res b/tests/sav/bench_complex_sort.res
new file mode 100644 (file)
index 0000000..3f09c96
--- /dev/null
@@ -0,0 +1,2 @@
+Eb3, Da7b9, Aa3, Da2b5, Cc6d3, Cc9d9, Da7b1, Da0b2, Aa8, Aa4, Aa1, Eb2, Cc8d6, Bb6, Cc4d9, Bb7, Cc7d4, Eb2, Bb8, Eb0
+Da0b2, Aa1, Da2b5, Bb6, Aa3, Bb7, Bb8, Aa4, Cc4d9, Eb3, Eb2, Eb2, Eb0, Cc6d3, Cc7d4, Da7b1, Da7b9, Cc8d6, Aa8, Cc9d9
diff --git a/tests/sav/bench_send.res b/tests/sav/bench_send.res
new file mode 100644 (file)
index 0000000..cb4ed12
--- /dev/null
@@ -0,0 +1,4 @@
+8192
+14336
+22528
+33792
diff --git a/tests/sav/bench_send2.res b/tests/sav/bench_send2.res
new file mode 100644 (file)
index 0000000..44053db
--- /dev/null
@@ -0,0 +1,60 @@
+1024
+0
+1024
+0
+0
+0
+1024
+0
+1024
+0
+0
+0
+1024
+0
+1024
+0
+0
+0
+1024
+0
+1024
+0
+0
+0
+1024
+0
+1024
+0
+0
+0
+1024
+0
+1024
+0
+0
+0
+1024
+0
+1024
+0
+0
+0
+1024
+0
+1024
+0
+0
+0
+1024
+0
+1024
+0
+0
+0
+1024
+0
+1024
+0
+0
+0