Changes in / [0300979:b9c04946]
- Location:
- src/tests
- Files:
-
- 3 edited
-
pybin/test_run.py (modified) (3 diffs)
-
pybin/tools.py (modified) (1 diff)
-
test.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/tests/pybin/test_run.py
r0300979 rb9c04946 28 28 29 29 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' )) 32 33 33 34 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)) 35 36 36 37 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)) 38 39 39 40 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)) 41 42 42 43 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)) 44 45 45 46 def target_output(self): … … 47 48 48 49 def target(self): 49 return os.path. normpath( os.path.join(self.path, self.name))50 return os.path.join(self.path, self.name) 50 51 51 52 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) 53 54 54 55 @classmethod … … 60 61 test = Test() 61 62 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) 63 64 test.arch = settings.arch.toString() if settings.arch.cross_compile else '' 64 65 return test -
src/tests/pybin/tools.py
r0300979 rb9c04946 57 57 except TypeError: 58 58 sh("rm -f %s > /dev/null 2>&1" % files ) 59 60 # Create 1 or more directory61 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) )67 59 68 60 def chdir( dest = __main__.__file__ ): -
src/tests/test.py
r0300979 rb9c04946 64 64 testname = canonicalPath( testname ) 65 65 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] 67 67 tests.append( found[0] if len(found) == 1 else Test.from_target(testname) ) 68 68 else : … … 137 137 test.prepare() 138 138 139 # remove any outputs from the previous tests to prevent side effects 140 rm( (out_file, err_file, exe_file) ) 141 139 142 # build, skipping to next test on error 140 143 before = time.time()
Note:
See TracChangeset
for help on using the changeset viewer.