diff --git a/scripts/verify.py b/scripts/verify.py index 09947723..c3981c3f 100644 --- a/scripts/verify.py +++ b/scripts/verify.py @@ -1465,7 +1465,7 @@ def _format_ground_truth_aggregate(ground_truth: list[dict]) -> str: def _format_ground_truth_verbose(ground_truth: list[dict]) -> list[str]: """Format ground truth as one line per core with expected values and source ref. - Example: handy validates size=512,crc32=0d973c9d [rom.h:48-49] + Example: handy validates crc32=0d973c9d,size=512 [lynx/rom.h:48-49] """ lines = [] for gt in ground_truth: diff --git a/tests/test_doc_pages.py b/tests/test_doc_pages.py index f7cf0260..30903f5c 100644 --- a/tests/test_doc_pages.py +++ b/tests/test_doc_pages.py @@ -478,5 +478,24 @@ class DeriveFiguresLiveWithTheTool(unittest.TestCase): self.assertIn("derivable.json", paragraph) +class EmulatorVerboseSample(unittest.TestCase): + """advanced-usage.md showed `handy validates size=512 crc32=0x0d973c9d + [src/handy/system.h:45]`, a format verify.py does not print and a + reference handy.yml does not cite.""" + + def test_every_sample_line_is_printed(self): + import subprocess + + section = _section(_page("advanced-usage.md"), "Per-emulator checks") + sample = [body for lang, body in re.findall(r"(?ms)^```(\w*)\n(.*?)^```", section) if not lang][-1] + printed = subprocess.run( + [sys.executable, "scripts/verify.py", "--emulator", "handy", "--verbose"], + cwd=ROOT, capture_output=True, text=True, check=True, + ).stdout.splitlines() + for line in sample.splitlines(): + with self.subTest(line=line): + self.assertIn(line, printed) + + if __name__ == "__main__": unittest.main() diff --git a/wiki/advanced-usage.md b/wiki/advanced-usage.md index 0379e491..97a88376 100644 --- a/wiki/advanced-usage.md +++ b/wiki/advanced-usage.md @@ -377,13 +377,16 @@ python scripts/verify.py --emulator handy python scripts/verify.py --emulator handy --verbose ``` -Default output shows aggregate results per file: the core name and which checks apply. -With `--verbose`, each file expands to one line per core with the exact validation -parameters and source code reference: +The first line counts the files the profile declares and names the checks they +carry. A file that is missing or fails a check gets a line of its own, followed by +the cores that check it. `--verbose` also lists the files that pass, each followed +by one line per core with the values it expects and the source reference the +profile cites: ``` -lynxboot.img - handy validates size=512 crc32=0x0d973c9d [src/handy/system.h:45] +handy: 2/2 OK [crc32+existence+size] + OK (optional): lynxboot.img + handy validates crc32=0d973c9d,size=512 [lynx/rom.h:48-49 (ROM_SIZE=0x200, ROM_CRC32=0x0D973C9D), lynx/rom.cpp:76-129 (CRom constructor), libretro/libretro.cpp:1231-1258 (bios path + CSystem init)] ``` ### Per-system checks