tests/run-tests.py
changeset 19238 4122de8003e4
parent 19134 75031762aff2
child 19239 db978c792b02
equal deleted inserted replaced
19237:1bef6f99a12d 19238:4122de8003e4
   906 
   906 
   907     ref = os.path.join(TESTDIR, test+".out")
   907     ref = os.path.join(TESTDIR, test+".out")
   908     err = os.path.join(TESTDIR, test+".err")
   908     err = os.path.join(TESTDIR, test+".err")
   909     if os.path.exists(err):
   909     if os.path.exists(err):
   910         os.remove(err)       # Remove any previous output files
   910         os.remove(err)       # Remove any previous output files
   911     try:
       
   912         tf = open(testpath)
       
   913         firstline = tf.readline().rstrip()
       
   914         tf.close()
       
   915     except IOError:
       
   916         firstline = ''
       
   917     lctest = test.lower()
   911     lctest = test.lower()
   918 
   912 
   919     if lctest.endswith('.py') or firstline == '#!/usr/bin/env python':
   913     if lctest.endswith('.py'):
   920         runner = pytest
   914         runner = pytest
   921     elif lctest.endswith('.t'):
   915     elif lctest.endswith('.t'):
   922         runner = tsttest
   916         runner = tsttest
   923         ref = testpath
   917         ref = testpath
   924     else:
   918     else: