tests.test_binary module¶
Tests for repomatic.release.binary: the build roster and its asset names.
- tests.test_binary.SHT_STRTAB = 3¶
ELF section type of a string table.
- tests.test_binary.make_elf(machine, versions=(), *, wide=True, big_endian=False)[source]¶
Craft a minimal ELF file, requiring versions of libc when given.
Without versions the file holds a bare header and no section table. With them it carries a
.dynstrstring table and a.gnu.version_rsection naming each one under a singlelibc.so.6requirement, the way the linker writes them. wide picks ELF64 over ELF32, and big_endian the byte order, as the identification bytes declare them.- Return type:
- tests.test_binary.pack_macho_version(version)[source]¶
Pack a
major.minorstring into a Mach-O version integer.- Return type:
- tests.test_binary.make_macho(cpu_type, min_os='11.0')[source]¶
Craft a minimal 64-bit Mach-O header with one LC_BUILD_VERSION command.
- Return type:
- tests.test_binary.make_fat(slices)[source]¶
Wrap Mach-O slices into a universal (fat) container.
- Return type:
- tests.test_binary.make_pe(machine)[source]¶
Craft a minimal PE header exposing only the COFF machine type.
- Return type:
- tests.test_binary.macho_cpu_type(arch)[source]¶
The Mach-O
cputypefor an architecture, read for the byte builders.MACHINE_IDSspans every format. These two accessors name the format for the helpers below, which write real header bytes.- Return type:
- tests.test_binary.pe_machine_id(arch)[source]¶
The PE COFF
Machinevalue for an architecture.- Return type:
- tests.test_binary.test_all_targets_present(target)[source]¶
All expected targets are in the mapping.
- tests.test_binary.test_pack_binary_assets(tmp_path)[source]¶
Aliases are byte-identical copies; Python distributions are skipped.
- tests.test_binary.test_binary_format_detection(tmp_path, payload, expected)[source]¶
Executable formats are recognized from their magic bytes.
- tests.test_binary.ASSET_ARCH_LABELS = {Architecture(id='aarch64', name='ARM64 (AArch64)'): 'arm64', Architecture(id='x86_64', name='x86-64 (AMD64)'): 'x64'}¶
Short architecture spellings frozen into the published release-asset names.
BuildTarget.archcarries the canonical extra-platforms id (aarch64,x86_64), while every published download URL saysarm64orx64. This maps one onto the other, so a target key and its fields cannot drift apart.
- tests.test_binary.test_matrix_entry_is_json_safe(target_id, build_target)[source]¶
No extra-platforms trait may leak into the GitHub matrix.
build_targetsandnuitka_matrixare serialized into the metadata JSON the release workflow reads, so anArchitectureobject reaching one of those dicts breaks the whole release lane at metadata time.- Return type:
- tests.test_binary.test_enforced_floor_follows_binary_format(target_id, build_target)[source]¶
Only ELF and Mach-O record a floor a scan can measure.
A PE carries a nominal version header, so its declared floor stays documentation and
verify_binary_floorhas nothing to enforce. The format’sfloor_labelis what says which of the two a target is in.- Return type:
- tests.test_binary.test_macos_compiles_without_ccache_at_its_floor(target_id, build_target)[source]¶
macOS turns ccache off, keeps no cache, and pins its deployment target.
Every other target adds no option and no variable, and keeps its cache.
- Return type:
- tests.test_binary.test_current_build_target(monkeypatch, platform, architecture, expected)[source]¶
The machine’s platform and architecture pick its target.
