Back to list
huynq55-v2

kernel-testing

by huynq55-v2

0🍴 0📅 Jan 15, 2026

SKILL.md


name: Kernel Testing description: Automated testing workflow for the Kernel using QEMU and Rust's custom test frameworks.

Kernel Testing Skill

This skill allows you to run unit and integration tests for the kernel, verifying functionality on QEMU.

1. Running Tests

To run the kernel test suite:

chmod +x run-test.sh
./run-test.sh

2. How it Works

  1. Compilation: The kernel is compiled in test mode, which includes the custom_test_frameworks harness and a test_main entry point.
  2. UEFI Boot: The test kernel is packaged into a UEFI bootable image, similar to the main OS.
  3. QEMU Execution: The scripts launches QEMU with a special isa-debug-exit device.
  4. Reporting:
    • Tests results are printed to the Serial Port.
    • Pass: QEMU exits with status 33 ((0x10 << 1) | 1).
    • Fail/Panic: QEMU exits with status 35 ((0x11 << 1) | 1).
    • The run-test.sh script captures this exit code and reports PASS or FAIL.

3. Adding New Tests

Add #[test_case] to any function in the kernel to register it as a test.

#[cfg(test)]
#[test_case]
fn trivial_assertion() {
    assert_eq!(1, 1);
}

4. Troubleshooting

  • If QEMU hangs, check if the isa-debug-exit device is correctly configured in run-test.sh.
  • Ensure test_main() is conditionally called in _start inside kernel/src/main.rs.

Score

Total Score

40/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon