Changes in / [0300979:b9c04946]


Ignore:
Location:
src/tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/tests/pybin/test_run.py

    r0300979 rb9c04946  
    2828
    2929        def prepare(self):
    30                 mkdir( (self.output_log(), self.error_log(), self.input()            ) )
    31                 rm   ( (self.output_log(), self.error_log(), self.target_executable()) )
     30                sh("mkdir -p %s" % os.path.join(self.path, '.err'))
     31                sh("mkdir -p %s" % os.path.join(self.path, '.out'))
     32                sh("mkdir -p %s" % os.path.join(self.path, '.in' ))
    3233
    3334        def expect(self):
    34                 return os.path.normpath( os.path.join(settings.SRCDIR  , self.path, ".expect", "%s%s.txt" % (self.name,'' if not self.arch else ".%s" % self.arch)) )
     35                return ("%s.expect/%s%s.txt" % (os.path.join(settings.SRCDIR, self.path), self.name, '' if not self.arch else ".%s" % self.arch))
    3536
    3637        def error_log(self):
    37                 return os.path.normpath( os.path.join(settings.BUILDDIR, self.path, ".err"   , "%s.log" % self.name) )
     38                return ("%s.err/%s.log"    % (os.path.join(settings.BUILDDIR, self.path), self.name))
    3839
    3940        def output_log(self):
    40                 return os.path.normpath( os.path.join(settings.BUILDDIR, self.path, ".out"   , "%s.log" % self.name) )
     41                return ("%s.out/%s.log"    % (os.path.join(settings.BUILDDIR, self.path), self.name))
    4142
    4243        def input(self):
    43                 return os.path.normpath( os.path.join(settings.SRCDIR  , self.path, ".in"    , "%s.txt" % self.name) )
     44                return ("%s.in/%s.txt"     % (os.path.join(settings.SRCDIR, self.path), self.name))
    4445
    4546        def target_output(self):
     
    4748
    4849        def target(self):
    49                 return os.path.normpath( os.path.join(self.path, self.name) )
     50                return os.path.join(self.path, self.name)
    5051
    5152        def target_executable(self):
    52                 return os.path.normpath( os.path.join(settings.BUILDDIR, self.path, self.name) )
     53                return os.path.join(settings.BUILDDIR, self.path, self.name)
    5354
    5455        @classmethod
     
    6061                test = Test()
    6162                test.name = os.path.basename(target)
    62                 test.path = os.path.relpath (os.path.dirname(target), settings.SRCDIR)
     63                test.path = os.path.dirname (target)
    6364                test.arch = settings.arch.toString() if settings.arch.cross_compile else ''
    6465                return test
  • src/tests/pybin/tools.py

    r0300979 rb9c04946  
    5757        except TypeError:
    5858                sh("rm -f %s > /dev/null 2>&1" % files )
    59 
    60 # Create 1 or more directory
    61 def mkdir( files ):
    62         try:
    63                 for file in files:
    64                         sh("mkdir -p %s" % os.path.dirname(file) )
    65         except TypeError:
    66                 sh("mkdir -p %s" % os.path.dirname(files) )
    6759
    6860def chdir( dest = __main__.__file__ ):
  • src/tests/test.py

    r0300979 rb9c04946  
    6464                        testname = canonicalPath( testname )
    6565                        if Test.valid_name(testname):
    66                                 found = [test for test in allTests if canonicalPath( test.target() ) == testname]
     66                                found = [test for test in allTests if test.target() == testname]
    6767                                tests.append( found[0] if len(found) == 1 else Test.from_target(testname) )
    6868                        else :
     
    137137        test.prepare()
    138138
     139        # remove any outputs from the previous tests to prevent side effects
     140        rm( (out_file, err_file, exe_file) )
     141
    139142        # build, skipping to next test on error
    140143        before = time.time()
Note: See TracChangeset for help on using the changeset viewer.