mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-06 10:03:49 -06:00
docs: list pipeline flag refusals in one table
tools.md said --full-narrowings is refused with --skip-packs only, while pipeline.py also refuses it with --source platform or truth, and advanced-usage.md kept a second, shorter list. The tools table now carries every pair, checked against _refuse_unapplied_flags, and advanced-usage links to it.
This commit is contained in:
1 parent
da9e1f568c
commit
f255efca0f
3 files changed
+41
-2
No files matched your search
@@ -213,6 +213,45 @@ class AnOfflineExportWithNoOriginalsStopsFirst(unittest.TestCase):
|
||||
self.assertIn("export_native.py --all --refresh-cache", text)
|
||||
|
||||
|
||||
class ThePipelineFlagTableSaysEveryRefusal(unittest.TestCase):
|
||||
"""tools.md said --full-narrowings is refused with --skip-packs only, and
|
||||
advanced-usage.md kept its own shorter list: `--source truth
|
||||
--full-narrowings` failed with nothing on either page saying so."""
|
||||
|
||||
PAIRS = {"--source": "platform", "--all-variants": True, "--full-narrowings": True,
|
||||
"--skip-packs": True}
|
||||
|
||||
def _refused(self, flags: dict) -> bool:
|
||||
import argparse
|
||||
|
||||
args = argparse.Namespace(source=None, all_variants=False, full_narrowings=False,
|
||||
skip_packs=False)
|
||||
for flag, value in flags.items():
|
||||
setattr(args, flag.lstrip("-").replace("-", "_"), value)
|
||||
parser = mock.Mock()
|
||||
pipeline._refuse_unapplied_flags(parser, args)
|
||||
return parser.error.called
|
||||
|
||||
def test_each_refused_pair_is_in_the_row_of_a_flag(self):
|
||||
import itertools
|
||||
|
||||
text = (REPO_ROOT / "wiki" / "tools.md").read_text(encoding="utf-8")
|
||||
rows = {line.split("`")[1].split()[0]: line for line in text.splitlines()
|
||||
if line.startswith("| `--")}
|
||||
for (a, va), (b, vb) in itertools.combinations(self.PAIRS.items(), 2):
|
||||
if not self._refused({a: va, b: vb}):
|
||||
continue
|
||||
with self.subTest(pair=(a, b)):
|
||||
self.assertTrue(f"`{b}" in rows.get(a, "") or f"`{a}" in rows.get(b, ""),
|
||||
f"{a} with {b} is refused, and neither row says so")
|
||||
self.assertIn("`--source truth`", rows["--full-narrowings"])
|
||||
|
||||
def test_one_list_of_refusals(self):
|
||||
text = (REPO_ROOT / "wiki" / "advanced-usage.md").read_text(encoding="utf-8")
|
||||
self.assertNotIn("are refused with", text)
|
||||
self.assertIn("tools.md#pipeline", text)
|
||||
|
||||
|
||||
class TheTruthDiffShowsWhereAndAsksNothing(unittest.TestCase):
|
||||
"""The markdown wrote `**Remove** hiscore.dat (phantom)` beside six
|
||||
`**Add** hiscore.dat`, none with a path, for files profiled cores read."""
|
||||
|
||||
@@ -543,7 +543,7 @@ python scripts/pipeline.py --offline --with-export
|
||||
|
||||
### Combining flags
|
||||
|
||||
These flags compose (`--source` and `--all-variants` are refused with `--skip-packs`):
|
||||
These flags compose, except the pairs the [pipeline flags](tools.md#pipeline) table marks as refused:
|
||||
|
||||
```bash
|
||||
python scripts/pipeline.py --offline --skip-packs --skip-docs --with-truth --target switch
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ Pipeline flags:
|
||||
| `--target TARGET` | filter verify, packs and truth by hardware target |
|
||||
| `--source {platform,truth,full}` | pack file source, passed through to `generate_pack.py`. Refused with `--skip-packs` |
|
||||
| `--all-variants` | build the 6 source x required combinations. Refused with `--skip-packs` and with `--source` |
|
||||
| `--full-narrowings` | step 5 compares every region, target and system of each platform instead of three of each. Refused with `--skip-packs` |
|
||||
| `--full-narrowings` | step 5 compares every region, target and system of each platform instead of three of each. Refused with `--skip-packs` and with `--source platform` or `--source truth` |
|
||||
| `--check-buildbot` | run step 2b. Additive, and ignored under `--offline` |
|
||||
| `--with-truth` | run steps 2c and 2d |
|
||||
| `--with-export` | run steps 2c, 2d and 2e |
|
||||
|
||||
Reference in new issue
Block a user