llvm.org GIT mirror llvm / 9c7316f
Python compatibility fix for r198150 Remove the stat call error reporting for now. It wasn't essential so silent fallback should be fine here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198155 91177308-0d34-0410-b5e6-96231b3b80d8 Alp Toker 5 years ago
1 changed file(s) with 5 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
117117 fname = test.getFilePath()
118118 os.utime(fname, None)
119119
120 def sort_by_incremental_cache(run, litConfig):
120 def sort_by_incremental_cache(run):
121121 def sortIndex(test):
122 index = 0
123122 fname = test.getFilePath()
124123 try:
125 index = -os.path.getmtime(fname)
126 except OSError as e:
127 if litConfig.debug:
128 litConfig.note(e)
129 return index
124 return -os.path.getmtime(fname)
125 except:
126 return 0
130127 run.tests.sort(key = lambda t: sortIndex(t))
131128
132129 def main(builtinParameters = {}):
318315 if opts.shuffle:
319316 random.shuffle(run.tests)
320317 elif opts.incremental:
321 sort_by_incremental_cache(run, litConfig)
318 sort_by_incremental_cache(run)
322319 else:
323320 run.tests.sort(key = lambda t: t.getFullName())
324321