[pypy-svn] r37519 - pypy/dist/pypy/jit/codegen/demo

mwh at codespeak.net mwh at codespeak.net
Mon Jan 29 12:28:58 CET 2007


Author: mwh
Date: Mon Jan 29 12:28:53 2007
New Revision: 37519

Modified:
   pypy/dist/pypy/jit/codegen/demo/conftest.py
   pypy/dist/pypy/jit/codegen/demo/test_random.py
Log:
one more conftestification: the number of arguments the random function takes.


Modified: pypy/dist/pypy/jit/codegen/demo/conftest.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/demo/conftest.py	(original)
+++ pypy/dist/pypy/jit/codegen/demo/conftest.py	Mon Jan 29 12:28:53 2007
@@ -20,4 +20,8 @@
                default=20,
                dest="max_block_length",
                help="insert up to this many operations in each block"),
+        Option('--n-vars', action="store", type="int",
+               default=26,
+               dest="n_vars",
+               help="supply this many randomly-valued arguments to the function"),
         )

Modified: pypy/dist/pypy/jit/codegen/demo/test_random.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/demo/test_random.py	(original)
+++ pypy/dist/pypy/jit/codegen/demo/test_random.py	Mon Jan 29 12:28:53 2007
@@ -9,7 +9,7 @@
     #py.test.skip("in-progress")
     blocklabels = range(nb_blocks)
     r = Random()
-    vars = list("abcdefghijklmnopqrstuvwxyz")
+    vars = list("abcdefghijklmnopqrstuvwxyz"[:demo_conftest.option.n_vars])
     varlist = ', '.join(vars)
     magicsum = '+'.join(['%s*%d' % (v, hash(v)) for v in vars])
     operations = ['%s + %s',



More information about the Pypy-commit mailing list