@@ -13,7 +13,7 @@ use uefi::proto::console::serial::Serial;
13
13
use uefi:: proto:: device_path:: build:: { self , DevicePathBuilder } ;
14
14
use uefi:: proto:: device_path:: messaging:: Vendor ;
15
15
use uefi:: table:: boot:: { MemoryMap , MemoryType } ;
16
- use uefi:: { print, println, Result } ;
16
+ use uefi:: { print, println, system , Result } ;
17
17
18
18
mod boot;
19
19
mod fs;
@@ -45,6 +45,9 @@ fn efi_main(image: Handle, mut st: SystemTable<Boot>) -> Status {
45
45
// Ensure the tests are run on a version of UEFI we support.
46
46
check_revision ( st. uefi_revision ( ) ) ;
47
47
48
+ // Check the `uefi::system` module.
49
+ check_system ( & st) ;
50
+
48
51
// Test all the boot services.
49
52
let bt = st. boot_services ( ) ;
50
53
@@ -67,6 +70,8 @@ fn efi_main(image: Handle, mut st: SystemTable<Boot>) -> Status {
67
70
}
68
71
69
72
fn check_revision ( rev : uefi:: table:: Revision ) {
73
+ assert_eq ! ( system:: uefi_revision( ) , rev) ;
74
+
70
75
let ( major, minor) = ( rev. major ( ) , rev. minor ( ) ) ;
71
76
72
77
info ! ( "UEFI {}.{}" , major, minor / 10 ) ;
@@ -78,6 +83,25 @@ fn check_revision(rev: uefi::table::Revision) {
78
83
) ;
79
84
}
80
85
86
+ fn check_system ( st : & SystemTable < Boot > ) {
87
+ assert_eq ! ( system:: firmware_vendor( ) , cstr16!( "EDK II" ) ) ;
88
+ check_revision ( system:: uefi_revision ( ) ) ;
89
+
90
+ assert_eq ! ( system:: firmware_revision( ) , st. firmware_revision( ) ) ;
91
+ system:: with_config_table ( |t| assert_eq ! ( t, st. config_table( ) ) ) ;
92
+
93
+ system:: with_stdout ( |stdout| {
94
+ stdout
95
+ . output_string ( cstr16 ! ( "test system::with_stdout\n " ) )
96
+ . unwrap ( )
97
+ } ) ;
98
+ system:: with_stderr ( |stdout| {
99
+ stdout
100
+ . output_string ( cstr16 ! ( "test system::with_stderr\n " ) )
101
+ . unwrap ( )
102
+ } ) ;
103
+ }
104
+
81
105
#[ derive( Clone , Copy , Debug ) ]
82
106
enum HostRequest {
83
107
/// Tell the host to take a screenshot and compare against the
0 commit comments