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

Add core filename to output of fusesoc core show. #643

Merged
merged 1 commit into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions fusesoc/capi2/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ def __init__(

self.cache_root = cache_root

basename = os.path.basename(self.core_file)

self.core_basename = os.path.basename(self.core_file)
self.core_root = os.path.dirname(self.core_file)

# Populated by CoreDB._solve(). TODO: Find a better solution for that.
Expand Down Expand Up @@ -516,6 +515,7 @@ def info(self):
Name: {}
Description: {}
Core root: {}
Core file: {}
Targets:
{}"""
Expand All @@ -539,6 +539,7 @@ def info(self):
str(self.name),
str(self.get_description() or "<No description>"),
str(self.core_root),
str(self.core_basename),
targets,
)

Expand Down
6 changes: 5 additions & 1 deletion tests/test_capi2.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,11 @@ def test_capi2_info():
core = Core(Core2Parser(), core_file)

gen_info = "\n".join(
[x for x in core.info().split("\n") if not "Core root" in x]
[
x
for x in core.info().split("\n")
if not any([y in x for y in ["Core root", "Core file"]])
]
)
with open(os.path.join(tests_dir, __name__, core_name + ".info")) as f:
assert f.read() == gen_info, core_name
Expand Down
Loading