mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-18 09:23:26 -05:00
fix: list passing entries in verbose verify JSON
verify accepted --verbose beside --json and dropped it in every mode, so the output was the same with or without it. The JSON now lists every entry with its ground truth under --verbose.
This commit is contained in:
1 parent
8a9d6919d9
commit
1bdfb8d75e
3 files changed
+46
-8
No files matched your search
+13
-7
@@ -2165,9 +2165,7 @@ def _main(held: contextlib.ExitStack) -> None:
|
||||
regions=requested_regions, platforms_dir=args.platforms_dir,
|
||||
)
|
||||
if args.json:
|
||||
result["details"] = [
|
||||
d for d in result["details"] if d["status"] != Status.OK
|
||||
]
|
||||
result["details"] = _json_details(result["details"], args.verbose)
|
||||
print(json.dumps(result, indent=2))
|
||||
else:
|
||||
print_emulator_result(result, verbose=args.verbose)
|
||||
@@ -2182,9 +2180,7 @@ def _main(held: contextlib.ExitStack) -> None:
|
||||
regions=requested_regions, platforms_dir=args.platforms_dir,
|
||||
)
|
||||
if args.json:
|
||||
result["details"] = [
|
||||
d for d in result["details"] if d["status"] != Status.OK
|
||||
]
|
||||
result["details"] = _json_details(result["details"], args.verbose)
|
||||
print(json.dumps(result, indent=2))
|
||||
else:
|
||||
print_emulator_result(result, verbose=args.verbose)
|
||||
@@ -2255,12 +2251,22 @@ def _main(held: contextlib.ExitStack) -> None:
|
||||
|
||||
if args.json:
|
||||
for r in all_results.values():
|
||||
r["details"] = [d for d in r["details"] if d["status"] != Status.OK]
|
||||
r["details"] = _json_details(r["details"], args.verbose)
|
||||
print(json.dumps(all_results, indent=2))
|
||||
|
||||
_exit_if_strict(args.strict, [r for r, _ in group_results])
|
||||
|
||||
|
||||
def _json_details(details: list[dict], verbose: bool) -> list[dict]:
|
||||
"""The entries a JSON report lists: what needs attention, or every one.
|
||||
|
||||
--verbose shows each entry with its ground truth in the text report; it
|
||||
used to be accepted beside --json and dropped, the output byte for byte
|
||||
the same, so a script asking for the passing entries got nothing.
|
||||
"""
|
||||
return list(details) if verbose else [d for d in details if d["status"] != Status.OK]
|
||||
|
||||
|
||||
def _exit_if_strict(strict: bool, results: list[dict]) -> None:
|
||||
"""Exit 1 under --strict when a platform result counts a critical file:
|
||||
a required file missing or rejected where the frontend reads hashes."""
|
||||
|
||||
Reference in new issue
Block a user