Author: Armin Rigo <[email protected]>
Branch: stmgc-c7
Changeset: r75792:0bb524721029
Date: 2015-02-09 23:56 +0100
http://bitbucket.org/pypy/pypy/changeset/0bb524721029/

Log:    The tests pass now. Tweaks.

diff --git a/pypy/module/pypystm/test_pypy_c/support.py 
b/pypy/module/pypystm/test_pypy_c/support.py
--- a/pypy/module/pypystm/test_pypy_c/support.py
+++ b/pypy/module/pypystm/test_pypy_c/support.py
@@ -87,6 +87,7 @@
 
     def setup_method(self, meth):
         self.filepath = self.tmpdir.join(meth.im_func.func_name + '.py')
+        self.stmfile = self.filepath.new(ext='.stm')
         self.logfile = self.filepath.new(ext='.log')
 
     def _write_source(self, func_or_src, args=[]):
@@ -109,7 +110,8 @@
             cmdline.append('-S')
         cmdline.append(str(self.filepath))
         env = os.environ.copy()
-        env['PYPYSTM'] = str(self.logfile)
+        env['PYPYSTM'] = str(self.stmfile)
+        env['PYPYLOG'] = str(self.logfile)
         #
         pipe = subprocess.Popen(cmdline,
                                 env=env,
@@ -125,7 +127,7 @@
 
     def _parse_log(self):
         from pypy.stm.print_stm_log import StmLog
-        return StmLog(str(self.logfile))
+        return StmLog(str(self.stmfile))
 
     def _check_count_conflicts(self, func_or_src, args=[], **kwds):
         self._write_source(func_or_src, args)
diff --git a/pypy/module/pypystm/test_pypy_c/test_conflict.py 
b/pypy/module/pypystm/test_pypy_c/test_conflict.py
--- a/pypy/module/pypystm/test_pypy_c/test_conflict.py
+++ b/pypy/module/pypystm/test_pypy_c/test_conflict.py
@@ -10,7 +10,9 @@
             x = X()     # shared
             x.a = 0
             def g():
+                X()           #loc0
                 x.a += 1      #loc1
+                X()           #loc2
             run_in_threads(g)
         #
         self.check_MANY_conflicts(f, jit=jit)
@@ -57,7 +59,9 @@
             x.a = 0
             def g(tnum):
                 if tnum == 0:
+                    X()           #loc1
                     x.a += 1      #loc2
+                    X()           #loc3
                 else:
                     if x.a < 0:
                         raise AssertionError
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to