Changeset b067d9b for tests/pybin/test_run.py
- Timestamp:
- Oct 29, 2019, 4:01:24 PM (6 years ago)
- 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. - File:
-
- 1 moved
-
tests/pybin/test_run.py (moved) (moved from src/tests/pybin/test_run.py ) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/pybin/test_run.py
r7951100 rb067d9b 4 4 5 5 import pybin.settings 6 import datetime7 8 from string import Template9 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)18 6 19 7 # Test class that defines what a test is … … 28 16 29 17 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()) ) 33 20 34 21 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)) ) 36 23 37 24 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) ) 39 26 40 27 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) ) 42 29 43 30 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) ) 45 32 46 33 def target_output(self): … … 48 35 49 36 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) ) 51 41 52 42 @classmethod … … 58 48 test = Test() 59 49 test.name = os.path.basename(target) 60 test.path = os.path. dirname (target)61 test.arch = settings.arch.t oString()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 '' 62 52 return test 63 53
Note:
See TracChangeset
for help on using the changeset viewer.