forked from Imagelibrary/littlefs
Simplified test/bench suite finding logic in test.py/bench.py
These just take normal paths now, we weren't even using the magic test/bench suite finding logic since it's easier to just pass everything explicitly in our Makefile. The original test/bench suite finding logic was a bad idea anyways. This is what globs are for, and having custom path chasing logic is inconsistent and risks confusion.
This commit is contained in:
@@ -13,7 +13,6 @@ import collections as co
|
|||||||
import csv
|
import csv
|
||||||
import errno
|
import errno
|
||||||
import fnmatch
|
import fnmatch
|
||||||
import glob
|
|
||||||
import itertools as it
|
import itertools as it
|
||||||
import math as m
|
import math as m
|
||||||
import os
|
import os
|
||||||
@@ -260,20 +259,8 @@ class BenchSuite:
|
|||||||
|
|
||||||
|
|
||||||
def compile(bench_paths, **args):
|
def compile(bench_paths, **args):
|
||||||
# find .toml files
|
|
||||||
paths = []
|
|
||||||
for path in bench_paths:
|
|
||||||
if os.path.isdir(path):
|
|
||||||
path = path + '/*.toml'
|
|
||||||
|
|
||||||
if '*' in path:
|
|
||||||
for path in glob.glob(path):
|
|
||||||
paths.append(path)
|
|
||||||
else:
|
|
||||||
paths.append(path)
|
|
||||||
|
|
||||||
# load the suites
|
# load the suites
|
||||||
suites = [BenchSuite(path, args) for path in paths]
|
suites = [BenchSuite(path, args) for path in bench_paths]
|
||||||
|
|
||||||
# sort suites by:
|
# sort suites by:
|
||||||
# 1. topologically by "after" dependencies
|
# 1. topologically by "after" dependencies
|
||||||
@@ -1624,8 +1611,7 @@ if __name__ == "__main__":
|
|||||||
comp_parser.add_argument(
|
comp_parser.add_argument(
|
||||||
'bench_paths',
|
'bench_paths',
|
||||||
nargs='*',
|
nargs='*',
|
||||||
help="Description of *.toml files to compile. May be a directory "
|
help="Set of *.toml files to compile.")
|
||||||
"or a list of paths.")
|
|
||||||
comp_parser.add_argument(
|
comp_parser.add_argument(
|
||||||
'-c', '--compile',
|
'-c', '--compile',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import collections as co
|
|||||||
import csv
|
import csv
|
||||||
import errno
|
import errno
|
||||||
import fnmatch
|
import fnmatch
|
||||||
import glob
|
|
||||||
import itertools as it
|
import itertools as it
|
||||||
import math as m
|
import math as m
|
||||||
import os
|
import os
|
||||||
@@ -265,20 +264,8 @@ class TestSuite:
|
|||||||
|
|
||||||
|
|
||||||
def compile(test_paths, **args):
|
def compile(test_paths, **args):
|
||||||
# find .toml files
|
|
||||||
paths = []
|
|
||||||
for path in test_paths:
|
|
||||||
if os.path.isdir(path):
|
|
||||||
path = path + '/*.toml'
|
|
||||||
|
|
||||||
if '*' in path:
|
|
||||||
for path in glob.glob(path):
|
|
||||||
paths.append(path)
|
|
||||||
else:
|
|
||||||
paths.append(path)
|
|
||||||
|
|
||||||
# load the suites
|
# load the suites
|
||||||
suites = [TestSuite(path, args) for path in paths]
|
suites = [TestSuite(path, args) for path in test_paths]
|
||||||
|
|
||||||
# sort suites by:
|
# sort suites by:
|
||||||
# 1. topologically by "after" dependencies
|
# 1. topologically by "after" dependencies
|
||||||
@@ -1653,8 +1640,7 @@ if __name__ == "__main__":
|
|||||||
comp_parser.add_argument(
|
comp_parser.add_argument(
|
||||||
'test_paths',
|
'test_paths',
|
||||||
nargs='*',
|
nargs='*',
|
||||||
help="Description of *.toml files to compile. May be a directory "
|
help="Set of *.toml files to compile.")
|
||||||
"or a list of paths.")
|
|
||||||
comp_parser.add_argument(
|
comp_parser.add_argument(
|
||||||
'-c', '--compile',
|
'-c', '--compile',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
|
|||||||
Reference in New Issue
Block a user