Skip to content

Conversation

@kuqin12
Copy link
Contributor

@kuqin12 kuqin12 commented Jan 13, 2026

Description

This change adds support for running unit tests on AArch64 hosts, which would help to expose test cases not covered by normal X64 unit tests.

Resolves #1514.

For details on how to complete these options and their meaning refer to CONTRIBUTING.md.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

This was tested on AArch64 hardware platform and passed all existing unit tests.

Integration Instructions

N/A

@codecov-commenter
Copy link

codecov-commenter commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release/202502@ba9f76c). Learn more about missing BASE report.

Files with missing lines Patch % Lines
MdePkg/Library/BaseLib/AArch64UnitTestHost.c 0.00% 8 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##             release/202502    #1613   +/-   ##
=================================================
  Coverage                  ?    2.22%           
=================================================
  Files                     ?     1461           
  Lines                     ?   381067           
  Branches                  ?     4584           
=================================================
  Hits                      ?     8477           
  Misses                    ?   372517           
  Partials                  ?       73           
Flag Coverage Δ
MdeModulePkg 1.55% <ø> (?)
MdePkg 5.45% <0.00%> (?)
NetworkPkg 0.55% <ø> (?)
PolicyServicePkg 30.42% <ø> (?)
UefiCpuPkg 4.92% <ø> (?)
UnitTestFrameworkPkg 11.40% <ø> (?)

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.

@makubacki makubacki self-requested a review January 14, 2026 03:03
@kuqin12 kuqin12 force-pushed the unit_test_arm64_2502 branch 2 times, most recently from eb2963e to 9c4074d Compare January 20, 2026 22:01
@kuqin12 kuqin12 changed the title Supporting unit test that runs on AArch64 [Rebase & FF] Supporting unit test that runs on AArch64 Jan 20, 2026
This change adds a few preprocessors to build AArch64 host based unit
tests properly.

An AArch64 specific instance of `gUnitTestHostBaseLib` is created to
abstract the reference of arch specific special instructions.

Signed-off-by: Kun Qin <kuqin12@gmail.com>
Current FunctionMockLib is relying on the subhoob module to support the
backend operation by bitbanging the binary post-disassembly.

However subhook module is a x64 centric module and does not support
AArch64 usage.

This change removes the mock function support for AArch64. The
functionality will need other solutions to be properly supported.

Signed-off-by: Kun Qin <kuqin12@gmail.com>
…rch64

AArch64 does not have divide-by-zero exception.

This change modifies the corresponding test to work with AArch64.

Signed-off-by: Kun Qin <kuqin12@gmail.com>
This change adds the support of float operations for AArch64 host based
unit tests by overriding the compiler flags.

Signed-off-by: Kun Qin <kuqin12@gmail.com>
This change adds the GCC compiler flag for AArch64 targets.

Signed-off-by: Kun Qin <kuqin12@gmail.com>
This change adds the DLINK flags for AArch64 targets to support host
based unit tests to be run on native AArch64 host systems.

Signed-off-by: Kun Qin <kuqin12@gmail.com>
This change adds the AArch64 target for host based unit tests.

Signed-off-by: Kun Qin <kuqin12@gmail.com>
This change adds the AArch64 target for host based unit tests.

Signed-off-by: Kun Qin <kuqin12@gmail.com>
This change adds the AArch64 target for host based unit tests.

Signed-off-by: Kun Qin <kuqin12@gmail.com>
This change adds the AArch64 target for host based unit tests.

Signed-off-by: Kun Qin <kuqin12@gmail.com>
This change adds the AArch64 target for host based unit tests.

Signed-off-by: Kun Qin <kuqin12@gmail.com>
@kuqin12 kuqin12 force-pushed the unit_test_arm64_2502 branch from 9c4074d to ab6ef07 Compare January 23, 2026 09:10
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.

[Feature]: Support Host-Based Unit Tests on AArch64 platforms

2 participants