Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test names not dependent on disk location of root #2630

Merged
merged 1 commit into from
Sep 10, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tools/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1978,12 +1978,12 @@ def get_default_test_options_parser():
help='Prints script version and exits')
return parser

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

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

return tests
Expand Down