Skip to content

Commit df72753

Browse files
author
Olli-Pekka Puolitaival
committed
Fix after rebase
1 parent 0a91f6c commit df72753

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

tools/test_api.py

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,11 +2110,22 @@ def find_tests(base_dir, target_name, toolchain_name, icetea, greentea, app_conf
21102110
d = join(directory, test_group_directory, test_case_directory)
21112111
if not isdir(d) or ignoreset.is_ignored(d):
21122112
continue
2113-
if 'device' == subdir:
2114-
for test_dir in os.listdir(d):
2115-
test_dir_path = join(d, test_dir)
2116-
test_name = test_path_to_name(test_dir_path, base_dir)
2117-
tests[(test_name, directory, subdir, test_dir)] = [test_dir_path]
2113+
special_dirs = ['host_tests', 'COMMON']
2114+
if test_group_directory not in special_dirs and test_case_directory not in special_dirs:
2115+
test_name = test_path_to_name(d, base_dir)
2116+
tests[(test_name, directory, test_group_directory, test_case_directory)] = [d]
2117+
if test_case_directory == 'COMMON':
2118+
def predicate(base_pred, group_pred, name_base_group_case):
2119+
(name, base, group, case) = name_base_group_case
2120+
return base == base_pred and group == group_pred
2121+
2122+
commons.append((functools.partial(predicate, directory, test_group_directory), d))
2123+
if test_group_directory == 'COMMON':
2124+
def predicate(base_pred, name_base_group_case):
2125+
(name, base, group, case) = name_base_group_case
2126+
return base == base_pred
2127+
2128+
commons.append((functools.partial(predicate, directory), grp_dir))
21182129

21192130
if icetea:
21202131
dirs = [d for d in base_resources.ignored_dirs if basename(d) == 'TEST_APPS']
@@ -2124,6 +2135,12 @@ def find_tests(base_dir, target_name, toolchain_name, icetea, greentea, app_conf
21242135
for subdir in os.listdir(directory):
21252136
d = join(directory, subdir)
21262137
if not isdir(d):
2138+
continue
2139+
if 'device' == subdir:
2140+
for test_dir in os.listdir(d):
2141+
test_dir_path = join(d, test_dir)
2142+
test_name = test_path_to_name(test_dir_path, base_dir)
2143+
tests[(test_name, directory, subdir, test_dir)] = [test_dir_path]
21272144

21282145
# Apply common directories
21292146
for pred, path in commons:

0 commit comments

Comments
 (0)