Skip to content

test: raise coverage for src/arx/codegen.py (link=False, link_mode branches) #42

@omsherikar

Description

@omsherikar

Summary

src/arx/codegen.ArxBuilder.build has uncovered branches for object-only output and explicit pie / no-pie link modes (~86% file coverage).

Gaps (from pytest --cov=arx --cov-report=term-missing)

  • link=False: write object bytes directly to output_file and return (~90–92).
  • Invalid link_mode defensive ValueError on builder (~95) — if reachable from public API, assert with a test.
  • link_mode == \"pie\" / \"no-pie\": clang argument branches when linking (~103, ~105).

Suggested approach

  • Add or extend tests in tests/test_codegen_ast_output.py / tests/test_codegen_file_object.py per existing CI patterns (some paths require clang).

Evidence

Recent local run: codegen.py ~42 statements, ~6 missed (~86% cover).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions