[pypy-commit] stmgc default: add all demos to tests

Raemi noreply at buildbot.pypy.org
Mon Aug 18 13:58:39 CEST 2014


Author: Remi Meier <remi.meier at inf.ethz.ch>
Branch: 
Changeset: r1318:ec5c149ff346
Date: 2014-08-18 13:58 +0200
http://bitbucket.org/pypy/stmgc/changeset/ec5c149ff346/

Log:	add all demos to tests

diff --git a/c7/demo/demo_simple.c b/c7/demo/demo_simple.c
--- a/c7/demo/demo_simple.c
+++ b/c7/demo/demo_simple.c
@@ -10,7 +10,7 @@
 #  include "stmgc.h"
 #endif
 
-#define ITERS 1000000
+#define ITERS 100000
 #define NTHREADS    2
 
 
@@ -59,14 +59,16 @@
 void *demo2(void *arg)
 {
     int status;
+    rewind_jmp_buf rjbuf;
     stm_register_thread_local(&stm_thread_local);
+    stm_rewind_jmp_enterframe(&stm_thread_local, &rjbuf);
     char *org = (char *)stm_thread_local.shadowstack;
     tl_counter = 0;
 
     object_t *tmp;
     int i = 0;
     while (i < ITERS) {
-        stm_start_inevitable_transaction(&stm_thread_local);
+        stm_start_transaction(&stm_thread_local);
         tl_counter++;
         if (i % 500 < 250)
             STM_PUSH_ROOT(stm_thread_local, stm_allocate(16));//gl_counter++;
@@ -76,8 +78,9 @@
         i++;
     }
 
-    assert(org == (char *)stm_thread_local.shadowstack);
+    OPT_ASSERT(org == (char *)stm_thread_local.shadowstack);
 
+    stm_rewind_jmp_leaveframe(&stm_thread_local, &rjbuf);
     stm_unregister_thread_local(&stm_thread_local);
     status = sem_post(&done); assert(status == 0);
     return NULL;
diff --git a/c7/test/test_demo.py b/c7/test/test_demo.py
--- a/c7/test/test_demo.py
+++ b/c7/test/test_demo.py
@@ -15,6 +15,19 @@
 
     def test_shadowstack(self):   self.make_and_run("debug-test_shadowstack")
 
-    def test_demo2_debug(self):   self.make_and_run("debug-demo2")
+    def test_demo_simple_build(self):   self.make_and_run("build-demo_simple")
+    def test_demo_largemalloc_build(self):   self.make_and_run("build-demo_largemalloc")
+
+
+
+    # def test_demo2_debug(self):   self.make_and_run("debug-demo2")
     def test_demo2_build(self):   self.make_and_run("build-demo2")
     def test_demo2_release(self): self.make_and_run("release-demo2")
+
+    # def test_demo_random_debug(self):   self.make_and_run("debug-demo_random")
+    def test_demo_random_build(self):   self.make_and_run("build-demo_random")
+    def test_demo_random_release(self): self.make_and_run("release-demo_random")
+
+    # def test_demo_random2_debug(self):   self.make_and_run("debug-demo_random2")
+    def test_demo_random2_build(self):   self.make_and_run("build-demo_random2")
+    def test_demo_random2_release(self): self.make_and_run("release-demo_random2")


More information about the pypy-commit mailing list