Skip to content

test: cover ArxBuilder link and link_mode paths#46

Open
omsherikar wants to merge 2 commits intoarxlang:mainfrom
omsherikar:test/codegen-issue-42
Open

test: cover ArxBuilder link and link_mode paths#46
omsherikar wants to merge 2 commits intoarxlang:mainfrom
omsherikar:test/codegen-issue-42

Conversation

@omsherikar
Copy link
Copy Markdown
Contributor

Exercise link=False object output, invalid link_mode, and pie/no-pie clang flags (closes codegen coverage gaps).

solves #42

Exercise link=False object output, invalid link_mode, and pie/no-pie clang flags (closes codegen coverage gaps).
Copilot AI review requested due to automatic review settings April 6, 2026 18:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds targeted tests to close code coverage gaps in src/arx/codegen.py around object-only output (link=False), invalid link_mode handling, and explicit pie / no-pie linker-flag selection.

Changes:

  • Add a minimal module parsing helper to reduce repetition in codegen tests.
  • Add a test asserting link=False writes the emitted object bytes directly to output_file.
  • Add tests for invalid link_mode and for forwarding -pie / -no-pie to the clang invocation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

("no-pie", "-no-pie"),
],
)
@pytest.mark.skipif(not HAS_CLANG, reason="clang is required for object build")
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_build_passes_explicit_link_flags monkeypatches arx.codegen.xh.clang, so it no longer needs a real clang binary on PATH. The current @skipif(not HAS_CLANG, ...) will unnecessarily skip this coverage in environments without clang and the skip reason is misleading; consider removing the skip or changing the condition/reason to reflect the actual prerequisite (e.g., only skip when LLVM object emission isn’t available).

Suggested change
@pytest.mark.skipif(not HAS_CLANG, reason="clang is required for object build")

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants