Sort all os.listdir and os.walk to keep things more reproducible

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-03-10 00:00:04 +00:00
parent 2e3f4c1484
commit a9160d2217
6 changed files with 21 additions and 16 deletions

View File

@@ -26,14 +26,15 @@ If given, run only the given tests. Otherwise, run all tests.
if self.env['tests'] == []:
baremetal_source_exts = (self.env['c_ext'], self.env['asm_ext'])
paths = []
for f in os.listdir(self.env['baremetal_source_dir']):
for f in sorted(os.listdir(self.env['baremetal_source_dir'])):
path = os.path.join(self.env['baremetal_source_dir'], f)
if os.path.isfile(path) and os.path.splitext(path)[1] in baremetal_source_exts:
paths.append(path)
for root, dirs, files in os.walk(self.env['baremetal_source_arch_dir'], topdown=True):
dirs[:] = [d for d in dirs if d != 'interactive']
for file in files:
path = os.path.join(root, file)
for root, dirnames, filenames in os.walk(self.env['baremetal_source_arch_dir'], topdown=True):
dirnames[:] = [d for d in dirnames if d != 'interactive']
dirnames.sort()
for filename in filenames:
path = os.path.join(root, filename)
if os.path.splitext(path)[1] in baremetal_source_exts:
paths.append(path)
sources = []