Skip to content

Commit 32262ca

Browse files
uefi-macros: Add pass tests for the entry macro
These new tests cover various valid uses of the `entry` macro.
1 parent 99ecb98 commit 32262ca

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

uefi-macros/tests/compilation.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
fn ui() {
33
let t = trybuild::TestCases::new();
44
t.compile_fail("tests/ui/fail/*.rs");
5+
t.pass("tests/ui/pass/*.rs");
56
}

uefi-macros/tests/ui/pass/entry.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use uefi::table::{Boot, SystemTable};
2+
use uefi::{entry, Handle, Status};
3+
4+
#[entry]
5+
fn efi_main(image: Handle, st: SystemTable<Boot>) -> Status {
6+
Status::SUCCESS
7+
}
8+
9+
// trybuild requires a `main` function.
10+
fn main() {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use uefi::table::{Boot, SystemTable};
2+
use uefi::{entry, Handle, Status};
3+
4+
#[entry]
5+
unsafe fn efi_main(image: Handle, st: SystemTable<Boot>) -> Status {
6+
Status::SUCCESS
7+
}
8+
9+
// trybuild requires a `main` function.
10+
fn main() {}

0 commit comments

Comments
 (0)