tests/run-tests.py
branchstable
changeset 1226 0dd96ff409e9
parent 1224 f3c19de4b29c
child 1227 afafc1812f7b
equal deleted inserted replaced
1224:f3c19de4b29c 1226:0dd96ff409e9
   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: