Ignore:
Timestamp:
Oct 29, 2019, 4:01:24 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
773db65, 9421f3d8
Parents:
7951100 (diff), 8364209 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 moved

Legend:

Unmodified
Added
Removed
  • tests/pybin/test_run.py

    r7951100 rb067d9b  
    44
    55import pybin.settings
    6 import datetime
    7 
    8 from string import Template
    9 
    10 class DeltaTemplate(Template):
    11     delimiter = "%"
    12 
    13 def strfdelta(tdelta, fmt):
    14     d["H"], rem = divmod(tdelta.seconds, 3600)
    15     d["M"], d["S"] = divmod(rem, 60)
    16     t = DeltaTemplate(fmt)
    17     return t.substitute(**d)
    186
    197# Test class that defines what a test is
     
    2816
    2917        def prepare(self):
    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' ))
     18                mkdir( (self.output_log(), self.error_log(), self.input()            ) )
     19                rm   ( (self.output_log(), self.error_log(), self.target_executable()) )
    3320
    3421        def expect(self):
    35                 return ("%s/.expect/%s%s.txt" % (self.path, self.name, '' if not self.arch else ".%s" % self.arch))
     22                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)) )
    3623
    3724        def error_log(self):
    38                 return ("%s/.err/%s.log"    % (self.path, self.name))
     25                return os.path.normpath( os.path.join(settings.BUILDDIR, self.path, ".err"   , "%s.log" % self.name) )
    3926
    4027        def output_log(self):
    41                 return ("%s/.out/%s.log"    % (self.path, self.name))
     28                return os.path.normpath( os.path.join(settings.BUILDDIR, self.path, ".out"   , "%s.log" % self.name) )
    4229
    4330        def input(self):
    44                 return ("%s/.in/%s.txt"     % (self.path, self.name))
     31                return os.path.normpath( os.path.join(settings.SRCDIR  , self.path, ".in"    , "%s.txt" % self.name) )
    4532
    4633        def target_output(self):
     
    4835
    4936        def target(self):
    50                 return os.path.join(self.path, self.name)
     37                return os.path.normpath( os.path.join(self.path, self.name) )
     38
     39        def target_executable(self):
     40                return os.path.normpath( os.path.join(settings.BUILDDIR, self.path, self.name) )
    5141
    5242        @classmethod
     
    5848                test = Test()
    5949                test.name = os.path.basename(target)
    60                 test.path = os.path.dirname (target)
    61                 test.arch = settings.arch.toString() if settings.arch.cross_compile else ''
     50                test.path = os.path.relpath (os.path.dirname(target), settings.SRCDIR)
     51                test.arch = settings.arch.target if settings.arch.cross_compile else ''
    6252                return test
    6353
Note: See TracChangeset for help on using the changeset viewer.