[pypy-svn] r38952 - pypy/dist/pypy/lang/js

santagada at codespeak.net santagada at codespeak.net
Thu Feb 15 20:32:38 CET 2007


Author: santagada
Date: Thu Feb 15 20:32:37 2007
New Revision: 38952

Modified:
   pypy/dist/pypy/lang/js/driver.py
Log:
using subprocess

Modified: pypy/dist/pypy/lang/js/driver.py
==============================================================================
--- pypy/dist/pypy/lang/js/driver.py	(original)
+++ pypy/dist/pypy/lang/js/driver.py	Thu Feb 15 20:32:37 2007
@@ -5,6 +5,7 @@
 import py
 import os
 import sys
+from subprocess import *
 
 pwd = path.local(__file__)
 shell = pwd.dirpath('test', 'ecma', 'shell.js')
@@ -22,10 +23,12 @@
 results = open('results.txt', 'w')
 for f in pwd.dirpath('test', 'ecma').visit(filter):
     print f.basename
-    stdout = os.popen('./js_interactive.py -n -f %s -f %s'%(shell.strpath,f.strpath), 'r')
+    cmd = './js_interactive.py -n -f %s -f %s'%(shell, f)
+    p = Popen(cmd, shell=True, stdout=PIPE)
+    
     passed = 0
     total = 0
-    for line in stdout.readlines():
+    for line in p.stdout.readlines():
         if "PASSED!" in line:
             passed += 1
             total += 1
@@ -34,6 +37,3 @@
         
     results.write('%s passed %s of %s tests\n'%(f.basename, passed, total))
     results.flush()
-
-            
-            



More information about the Pypy-commit mailing list