refactor: build platform packs without printing

build_platform_pack and build_split_packs return what the build came to and print nothing. print_platform_pack holds the report lines, and generate_pack and generate_split_packs compose the two. The variant choice, the plan and the data directory pass return their notices instead of printing them. The callers that silenced stdout to get a record now call the builder.
This commit is contained in:
Abdessamad Derraz committed 2026-11-22 02:26:45 +01:00
1 parent 977d3f6874
commit d8570c6480
15 files changed
+295 -205

No files matched your search

+4 -7
View File
@@ -9,9 +9,7 @@ from __future__ import annotations
import tests
import contextlib
import hashlib
import io
import os
import tempfile
import unittest
@@ -95,11 +93,10 @@ class ThePackReadmeNamesTheSpellingsItLeavesOut(unittest.TestCase):
platformpack.write_generated_member = capture
self.addCleanup(setattr, platformpack, "write_generated_member", real)
with contextlib.redirect_stdout(io.StringIO()):
platformpack.generate_pack(
"p", "platforms", self.db, "bios", "", emulators_dir="emulators",
offline=True, record=archive.PackRecord(),
)
platformpack.build_platform_pack(
"p", "platforms", self.db, "bios", "", emulators_dir="emulators",
offline=True, record=archive.PackRecord(),
)
return texts["README.txt"]
def test_a_platform_also_on_linux_names_them(self):