Skip to content

Commit da5a19f

Browse files
authored
Merge pull request #2630 from sarahmarshy/patch-4
Test names not dependent on disk location of root
2 parents bf36319 + ac11d94 commit da5a19f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/test_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,12 +1978,12 @@ def get_default_test_options_parser():
19781978
help='Prints script version and exits')
19791979
return parser
19801980

1981-
def test_path_to_name(path):
1981+
def test_path_to_name(path, base):
19821982
"""Change all slashes in a path into hyphens
19831983
This creates a unique cross-platform test name based on the path
19841984
This can eventually be overriden by a to-be-determined meta-data mechanism"""
19851985
name_parts = []
1986-
head, tail = os.path.split(path)
1986+
head, tail = os.path.split(relpath(path,base))
19871987
while (tail and tail != "."):
19881988
name_parts.insert(0, tail)
19891989
head, tail = os.path.split(head)
@@ -2028,7 +2028,7 @@ def find_tests(base_dir, target_name, toolchain_name, options=None):
20282028

20292029
# Check to make sure discoverd folder is not in a host test directory
20302030
if test_case_directory != 'host_tests' and test_group_directory != 'host_tests':
2031-
test_name = test_path_to_name(d)
2031+
test_name = test_path_to_name(d, base_dir)
20322032
tests[test_name] = d
20332033

20342034
return tests

0 commit comments

Comments
 (0)