Commits

ebo  committed e448237

Some cleanups.

  • Participants
  • Parent commits bc0fdba

Comments (0)

Files changed (2)

-pyfuzz is a random program generator for python. It was developed to test the JIT compiler of Unladen Swallow.
+pyfuzz is a random program generator for python. It was developed to test the 
+JIT compiler of Unladen Swallow.
 
 Website and repository:
 http://bitbucket.org/ebo/pyfuzz/
 
-Execute pgen-example.py to generate a new random program and output it to stdout.
+Execute pgen-example.py to generate a new random program and output it to 
+stdout.
 
-Execute pygen-example.py to test a python binary. You must specify a base and a test binary using the -b and -t commandline options. 
+Execute pygen-example.py to test a python binary. You must specify a base and 
+a test binary using the -b and -t commandline options.
+
+The pygen directory contains a module to represent a python program as an 
+object tree and transform it into a text representation.
+

File pygen-example.py

         clock_test = time.time() - clock_test
         time_test += clock_test
         totaltime += clock_test
-        
+
+        if p_test.returncode < 0:
+            print "------- Encountered crash: Test -------"
+            print code
+            print "---------------------------------------"
+            if options.break_on_error:
+                return
+
+       
         clock_base = time.time()
         p_base = subprocess.Popen([options.base] + options.baseargs.split() + ['code.py'],
                     stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
         time_base += clock_base
         totaltime += clock_base
         
-        if p_test.returncode == -11:
-            print "------- Encountered crash: Test -------"
-            print code
-            print "---------------------------------------"
-            if options.break_on_error:
-                return
 
-
-        if p_base.returncode == -11:
+        if p_base.returncode < 0:
             print "------- Encountered crash: Base -------"
             print code
             print "---------------------------------------"
 #            print code
         
         if (i+1) % 10 == 0:
-            print "%f Functions per Second" % ((i+1)/totaltime,)
-            print "Test: %f calls/sec | Base: %f calls/sec" % ((i+1)/time_test, (i+1)/time_base)
+            print "%f Functions per Second" % (i/totaltime,)
+            print "Test: %f calls/sec | Base: %f calls/sec" % (i/time_test, i/time_base)