Skip to content
Snippets Groups Projects
Commit d150e86d authored by Andre Maroneze's avatar Andre Maroneze Committed by Valentin Perrelle
Browse files

[analysis-scripts] check if the target is a directory before listing sub-targets

parent 45002bc7
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,9 @@ def build_env(framac):
return { **os.environ, 'PATH' : bindir + ':' + os.environ['PATH'] }
def list_targets(dir):
if not os.path.isdir(dir):
raise OperationException(f"target is not a directory: {dir}")
env = build_env(framac)
res = subprocess.run(
["make", "--directory", dir, "--quiet", "display-targets"],
......@@ -56,10 +59,9 @@ def list_targets(dir):
res = []
for target in targets:
if target.endswith(".eva") or target.endswith(".parse"):
res.append(dir + "/" + target)
res += [f"{dir}/{target}"]
else:
res += [dir + "/" + t for t in list_targets(target)]
print(f"list_targets returning: {res}")
res += list_targets(target)
return res
def clone_frama_c(clonedir, hash):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment