Commits

holger krekel committed b2ea1a5

revert to 28308 - using regrtest.py needs to be investigated
a lot more and it seems there were good reasons for not using it.
this means that test_threading.py will hang again, but trying
to tweak a different way to run tests resulted in more problems
(especially reporting wise)

  • Participants
  • Parent commits fa24584

Comments (0)

Files changed (1)

File lib-python/conftest.py

         python = sys.executable 
         pypy_script = pypydir.join('bin', 'py.py')
         alarm_script = pypydir.join('tool', 'alarm.py')
+        regr_script = pypydir.join('tool', 'pytest', 
+                                   'run-script', 'regrverbose.py')
         pypy_options = []
         if regrtest.oldstyle: 
             pypy_options.append('--oldstyle') 
         # previously we only did it if regrtest.outputpath() was True
         # the regrverbose script now does the logic that CPython
         # uses in its regrtest.py 
-       
-        #if regrtest.getoutputpath():
-        #    regr_script = pypydir.join('tool', 'pytest', 
-        #                  'run-script', 'regrverbose.py')
-        #    regr_script_options = "1"
-        #else:
-        regr_script = regrtestdir.join("regrtest.py")
-        regr_script_options = ""
-        if not regrtest.getoutputpath():
-            regr_script_options = "-v "
-       
-        regrrun = "%s %s" %(regr_script, regr_script_options)
+        regrrun = str(regr_script)
+        regrrun_verbosity = regrtest.getoutputpath() and '0' or '1'
+        
         TIMEOUT = gettimeout()
         if option.use_compiled:
             execpath, info = getexecutable()
-            cmd = "%s %s %s" %(
+            cmd = "%s %s %s %s" %(
                 execpath, 
-                regrrun, fspath.purebasename)
+                regrrun, regrrun_verbosity, fspath.purebasename)
+            print cmd
         else:
-            cmd = "%s %s %d %s %s %s %s" %(
+            cmd = "%s %s %d %s %s %s %s %s" %(
                 python, alarm_script, TIMEOUT, 
                 pypy_script, sopt, 
-                regrrun, fspath.purebasename)
+                regrrun, regrrun_verbosity, fspath.purebasename)
         return cmd 
 
     def run(self): 
         try: 
             stdout = tempdir.join(self.fspath.basename) + '.out'
             stderr = tempdir.join(self.fspath.basename) + '.err'
-            print >>sys.stderr, "executing:", cmd 
             if sys.platform == 'win32':
-                #stderr.write("executing: %s" %(cmd,)) XXX not sure we could append like below
                 status = os.system("%s >%s 2>%s" %(cmd, stdout, stderr))
                 if status>=0:
                     status = status
                 else:
                     status = 'abnormal termination 0x%x' % status
             else:
-                stderr.write("executing: %s\n" %(cmd,))
                 status = os.system("%s >>%s 2>>%s" %(cmd, stdout, stderr))
                 if os.WIFEXITED(status):
                     status = os.WEXITSTATUS(status)
 
         outcome = 'OK'
         expectedpath = regrtest.getoutputpath()
-        #if expectedpath is not None: 
-        #    if not exit_status: 
-        #        expected = expectedpath.read(mode='rU')
-        #        test_stdout = "%s\n%s" % (self.fspath.purebasename, test_stdout)     
-        #        if test_stdout != expected: 
-        #            exit_status = 2  
-        #            res, out, err = callcapture(reportdiff, expected, test_stdout)
-        #            outcome = 'ERROUT' 
-        #            result.addnamedtext('reportdiff', out)
-        #    else:
-        #        if 'FAIL' in test_stdout or 'ERROR' in test_stderr:
-        #            outcome = 'FAIL'
         if not exit_status: 
-            outcome = "OK"
-        elif exit_status and timedout: 
+            if expectedpath is not None: 
+                expected = expectedpath.read(mode='rU')
+                test_stdout = "%s\n%s" % (self.fspath.purebasename, test_stdout)     
+                if test_stdout != expected: 
+                    exit_status = 2  
+                    res, out, err = callcapture(reportdiff, expected, test_stdout)
+                    outcome = 'ERROUT' 
+                    result.addnamedtext('reportdiff', out)
+            else:
+                if 'FAIL' in test_stdout or 'ERROR' in test_stderr:
+                    outcome = 'FAIL'
+        elif timedout: 
             outcome = "T/O"    
         else: 
             outcome = "ERR"