Skip to content

Raise overall coverage to 85 percent#11

Merged
cpunion merged 6 commits intoxgo-dev:mainfrom
cpunion:coverage-85
Mar 14, 2026
Merged

Raise overall coverage to 85 percent#11
cpunion merged 6 commits intoxgo-dev:mainfrom
cpunion:coverage-85

Conversation

@cpunion
Copy link
Copy Markdown
Collaborator

@cpunion cpunion commented Mar 14, 2026

Summary

  • add deep coverage tests across amd64, arm64, translate, and scan paths
  • cover direct-module edge cases, FP literal/error branches, and amd64 ctx helper fallbacks
  • raise overall ok github.com/goplus/plan9asm 2.040s
    ok github.com/goplus/plan9asm/cmd/plan9asmscan 1.548s statement coverage to 85.0%

Verification

  • ok github.com/goplus/plan9asm (cached)
    ok github.com/goplus/plan9asm/cmd/plan9asmscan (cached)
  • ok github.com/goplus/plan9asm 1.671s coverage: 84.9% of statements
    ok github.com/goplus/plan9asm/cmd/plan9asmscan 1.119s coverage: 88.4% of statements
  • total: (statements) 85.0%

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly boosts the overall test coverage of the plan9asm project, aiming to achieve an 85% statement coverage target. It introduces a wide array of new and detailed test cases across multiple architectures (ARM, ARM64) and core functionalities, including instruction translation, operand evaluation, and tool-specific operations. The changes ensure greater stability and reliability by thoroughly testing various instruction types, edge conditions, and error handling mechanisms.

Highlights

  • Expanded ARM64 Test Coverage: Added extensive new test cases for the ARM64 architecture, covering atomic operations, arithmetic, data vectors, branches, floating-point operations, and syscalls, including various edge cases and error paths.
  • Enhanced ARM Test Coverage: Introduced new test cases for the ARM architecture, focusing on evaluation, floating-point operations, return handling, arithmetic, branches, MOVM instructions, and syscalls, ensuring broader test coverage.
  • Improved plan9asmscan Tool Testing: Expanded test coverage for the plan9asmscan tool, including functionality for listing standard packages, processing assembly files, generating reports, and handling command-line execution scenarios.
  • Deepened Go Module Translation Coverage: Added comprehensive test cases for Go module translation, covering helper functions, type conversions, signature generation, and various error handling scenarios during the translation process.
  • Miscellaneous Coverage Improvements: Enhanced test coverage for feature attribute registry, floating-point literal formatting, IR source comment emission, and configuration graph helper functions across different architectures.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • arm64_helper_edge_test.go
    • Added comprehensive test cases for ARM64 helper functions and edge cases, including atomic operations, arithmetic, data vectors, branches, floating-point operations, and syscalls.
  • arm_deep_coverage_test.go
    • Added new test cases for ARM evaluation, floating-point operations, return variants, extended arithmetic, branches, MOVM instructions, and syscalls.
  • arm_helper_edge_test.go
    • Added new test cases for ARM parser flags, helper functions, atomic operations, MOVM instructions, instruction edges, linear translation edge cases, and branch/syscall error handling.
  • arm_more_test.go
    • Added new test cases for ARM extended arithmetic, helper functions, and additional atomic forms, covering various branches, calls, and shift operations.
  • cmd/plan9asmscan/main_test.go
    • Updated test cases for listing standard packages, processing assembly files, adding operation statistics, scanning packages, building reports, and testing main function execution paths.
  • feature_attrs_test.go
    • Updated test cases for the feature attribute registry, verifying reference generation and emission of target features.
  • floatlit_test.go
    • Updated test cases for floating-point literal formatting, including exact forms and special values.
  • go_translate_deep_test.go
    • Added new test cases for Go translation helper functions, type conversions, signature generation, and error handling in module translation.
  • small_coverage_test.go
    • Added new test cases for IR source comment emission, IR module parsing errors, configuration graph helper functions, and AMD64 evalI64 coverage.
  • translate_deep_coverage_test.go
    • Added new test cases for preprocessor coverage edges, IR text translation, helper functions, direct module translation, linear translation, and return cast coverage.
  • types_deep_test.go
    • Added new test cases for operand string representation, symbol parsing, memory reference parsing, immediate expression evaluation, floating-point expression evaluation, and various type parser edge cases.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@fennoai
Copy link
Copy Markdown

fennoai Bot commented Mar 14, 2026

Good progress reaching 85% statement coverage. The test infrastructure helpers (newAMD64CtxWithFuncForTest, newARM64CtxWithFuncForTest, etc.) are well-structured. A few recurring issues worth addressing: the resolver closure is duplicated verbatim across all four helper functions; several omnibus test functions bundle 20+ unrelated behaviours with t.Fatalf, so a single early failure silently skips all remaining checks; and two logic issues in error-condition assertions may let real regressions pass undetected.

Comment thread amd64_helper_edge_test.go Outdated
Comment thread arm64_helper_edge_test.go Outdated
Comment thread arm_helper_edge_test.go Outdated
Comment thread cmd/plan9asmscan/main_test.go Outdated
Comment thread amd64_helper_edge_test.go
Comment thread amd64_helper_edge_test.go
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly increases test coverage across various architectures and components of the translator, which is a great improvement. The new tests are comprehensive and cover many edge cases. I've found one potential issue in a test where an llvm.Module is reused across sub-tests, which could lead to test interference. I've left a comment with a suggestion to address this. Overall, this is a high-quality contribution.

Comment thread translate_deep_coverage_test.go Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.48%. Comparing base (a28f694) to head (57e1925).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #11       +/-   ##
===========================================
+ Coverage   31.42%   69.48%   +38.06%     
===========================================
  Files          57       57               
  Lines       16380    16380               
===========================================
+ Hits         5147    11382     +6235     
+ Misses      10365     3683     -6682     
- Partials      868     1315      +447     
Flag Coverage Δ
unittests 69.48% <ø> (+38.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cpunion cpunion merged commit 7f506d4 into xgo-dev:main Mar 14, 2026
28 checks passed
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.

1 participant