mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-01 00:27:20 -05:00
feat: let the campaign read another content list
--content-file names the test content list for run and references.
This commit is contained in:
1 parent
873b645c0c
commit
a17406edae
3 files changed
+18
No files matched your search
@@ -1805,6 +1805,8 @@ def main(argv: Sequence[str] | None = None) -> int:
|
||||
scope.add_argument("--romfetch", default="",
|
||||
help=f"romfetch command (default: ${ROMFETCH_ENV}, else romfetch on PATH)")
|
||||
scope.add_argument("--offline", action="store_true", help="no buildbot, no romfetch, no build")
|
||||
scope.add_argument("--content-file", default=str(CONTENT_FILE),
|
||||
help="the test content list (default: tests/campaign/content.yml)")
|
||||
scope.add_argument("--allow-unsandboxed", action="store_true",
|
||||
help="run cores and builds without bubblewrap when it is missing (refused by default)")
|
||||
run_p = sub.add_parser("run", parents=[scope], help="one pass: cores, content, checks, rules")
|
||||
@@ -1862,6 +1864,8 @@ def main(argv: Sequence[str] | None = None) -> int:
|
||||
elif args.command == "references":
|
||||
settings = Settings(romfetch=args.romfetch, network=not args.offline,
|
||||
allow_unsandboxed=args.allow_unsandboxed)
|
||||
if args.command in ("run", "references"):
|
||||
paths.content_file = Path(args.content_file)
|
||||
campaign = Campaign(paths, settings)
|
||||
if args.command == "status":
|
||||
report = status_report(campaign)
|
||||
|
||||
@@ -882,6 +882,19 @@ class Findings(Workspace):
|
||||
self.assertIn("would commit 'chore: add campaign measurements'", out.getvalue())
|
||||
|
||||
|
||||
class ContentFile(Workspace):
|
||||
def test_a_content_list_can_be_named(self) -> None:
|
||||
other = self.tmp / "other.yml"
|
||||
other.write_text(yaml.safe_dump({"systems": {"fake-system": {
|
||||
"romfetch": "fakesys", "content": [{"name": "Other Game (Japan)", "catalog": "redump",
|
||||
"reason": "r"}]}}}), encoding="utf-8")
|
||||
out = io.StringIO()
|
||||
with unittest.mock.patch.object(campaign.Paths, "default", return_value=self.paths), \
|
||||
contextlib.redirect_stdout(out):
|
||||
self.assertEqual(campaign.main(["run", "--dry-run", "--content-file", str(other)]), 0)
|
||||
self.assertIn("Other Game (Japan)", out.getvalue())
|
||||
|
||||
|
||||
class InstallTimer(unittest.TestCase):
|
||||
def test_writes_the_units_and_enables_only_when_asked(self) -> None:
|
||||
calls = []
|
||||
|
||||
@@ -983,6 +983,7 @@ python scripts/campaign.py run --only beetle_psx,swanstation --dry-run
|
||||
python scripts/campaign.py run --commit --commit-every 10
|
||||
python scripts/campaign.py run --only pcsx_rearmed --bench # with benchmarks
|
||||
python scripts/campaign.py references --only beetle_psx --system sony-playstation
|
||||
python scripts/campaign.py references --only beetle_saturn --content-file other.yml # another content list
|
||||
python scripts/campaign.py status # done, failed, pending, and why
|
||||
python scripts/campaign.py findings # what waits for review
|
||||
python scripts/campaign.py gate # the checks behind a commit
|
||||
|
||||
Reference in new issue
Block a user