File tree 5 files changed +56
-9
lines changed
5 files changed +56
-9
lines changed Original file line number Diff line number Diff line change 74
74
# At least one unit test, for make_boxed() currently, has different behaviour dependent on
75
75
# the unstable feature.
76
76
- name : Run cargo test (with unstable)
77
- run : cargo xtask test --include- unstable
77
+ run : cargo xtask test --unstable
78
78
79
79
lints :
80
80
name : Lints
@@ -169,3 +169,19 @@ jobs:
169
169
170
170
- name : Build
171
171
run : cargo xtask build --feature-permutations
172
+
173
+ vm_test_unstable :
174
+ name : Run uefi-test-runner with `unstable` on x86_64
175
+ runs-on : ubuntu-latest
176
+ steps :
177
+ - name : Checkout sources
178
+ uses : actions/checkout@v3
179
+
180
+ - name : Install qemu and OVMF
181
+ run : |
182
+ sudo apt-get update
183
+ sudo apt-get install qemu-system-x86 ovmf -y
184
+
185
+ - name : Run VM tests
186
+ run : cargo xtask run --target x86_64 --headless --ci --unstable
187
+ timeout-minutes : 4
Original file line number Diff line number Diff line change @@ -6,8 +6,7 @@ publish = false
6
6
edition = " 2021"
7
7
8
8
[dependencies ]
9
- # TODO we should let the uefi-test-runner run with and without unstable.
10
- uefi = { path = " ../uefi" , features = [" alloc" , " unstable" ] }
9
+ uefi = { path = " ../uefi" , features = [" alloc" ] }
11
10
uefi-services = { path = " ../uefi-services" }
12
11
13
12
log = { version = " 0.4.17" , default-features = false }
@@ -21,6 +20,9 @@ multi_processor = []
21
20
# Enable the PXE test.
22
21
pxe = []
23
22
23
+ # Enable the `unstable` feature of the `uefi` crate.
24
+ unstable = [" uefi/unstable" ]
25
+
24
26
# Enable the TPM v1 test.
25
27
tpm_v1 = []
26
28
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ pub enum Feature {
60
60
// `uefi-test-runner` features.
61
61
MultiProcessor ,
62
62
Pxe ,
63
+ TestUnstable ,
63
64
TpmV1 ,
64
65
TpmV2 ,
65
66
}
@@ -79,6 +80,7 @@ impl Feature {
79
80
80
81
Self :: MultiProcessor => "uefi-test-runner/multi_processor" ,
81
82
Self :: Pxe => "uefi-test-runner/pxe" ,
83
+ Self :: TestUnstable => "uefi-test-runner/unstable" ,
82
84
Self :: TpmV1 => "uefi-test-runner/tpm_v1" ,
83
85
Self :: TpmV2 => "uefi-test-runner/tpm_v2" ,
84
86
}
@@ -96,7 +98,13 @@ impl Feature {
96
98
] ,
97
99
Package :: UefiServices => vec ! [ Self :: PanicHandler , Self :: Qemu , Self :: ServicesLogger ] ,
98
100
Package :: UefiTestRunner => {
99
- vec ! [ Self :: MultiProcessor , Self :: Pxe , Self :: TpmV1 , Self :: TpmV2 ]
101
+ vec ! [
102
+ Self :: MultiProcessor ,
103
+ Self :: Pxe ,
104
+ Self :: TestUnstable ,
105
+ Self :: TpmV1 ,
106
+ Self :: TpmV2 ,
107
+ ]
100
108
}
101
109
_ => vec ! [ ] ,
102
110
}
Original file line number Diff line number Diff line change @@ -142,6 +142,11 @@ fn run_vm_tests(opt: &QemuOpt) -> Result<()> {
142
142
features. push ( Feature :: MultiProcessor ) ;
143
143
}
144
144
145
+ // Enable `unstable` if requested.
146
+ if * opt. unstable {
147
+ features. push ( Feature :: TestUnstable ) ;
148
+ }
149
+
145
150
// Build uefi-test-runner.
146
151
let cargo = Cargo {
147
152
action : CargoAction :: Build ,
@@ -180,7 +185,7 @@ fn run_host_tests(test_opt: &TestOpt) -> Result<()> {
180
185
// the unstable feature. Because of this, we need to allow to test both variants. Runtime
181
186
// features is set to no as it is not possible as as soon a #[global_allocator] is
182
187
// registered, the Rust runtime executing the tests uses it as well.
183
- features : Feature :: more_code ( test_opt. include_unstable , false ) ,
188
+ features : Feature :: more_code ( * test_opt. unstable , false ) ,
184
189
// Don't test uefi-services (or the packages that depend on it)
185
190
// as it has lang items that conflict with `std`.
186
191
packages : vec ! [ Package :: Uefi , Package :: UefiMacros ] ,
Original file line number Diff line number Diff line change @@ -34,6 +34,21 @@ pub struct BuildModeOpt {
34
34
pub release : bool ,
35
35
}
36
36
37
+ #[ derive( Debug , Parser ) ]
38
+ pub struct UnstableOpt {
39
+ /// Enable the `unstable` feature (requires nightly).
40
+ #[ clap( long, action) ]
41
+ pub unstable : bool ,
42
+ }
43
+
44
+ impl Deref for UnstableOpt {
45
+ type Target = bool ;
46
+
47
+ fn deref ( & self ) -> & Self :: Target {
48
+ & self . unstable
49
+ }
50
+ }
51
+
37
52
#[ derive( Debug , Parser ) ]
38
53
pub struct WarningOpt {
39
54
/// Treat warnings as errors.
@@ -156,15 +171,16 @@ pub struct QemuOpt {
156
171
/// Run an example instead of the main binary.
157
172
#[ clap( long, action) ]
158
173
pub example : Option < String > ,
174
+
175
+ #[ clap( flatten) ]
176
+ pub unstable : UnstableOpt ,
159
177
}
160
178
161
179
/// Run unit tests and doctests on the host.
162
180
#[ derive( Debug , Parser ) ]
163
181
pub struct TestOpt {
164
- /// Include all features behind the "unstable" gate. uefi-rs must build without unstable
165
- /// functionality on stable (eventually) and with it in our nightly MSRV.
166
- #[ clap( long, action) ]
167
- pub include_unstable : bool ,
182
+ #[ clap( flatten) ]
183
+ pub unstable : UnstableOpt ,
168
184
}
169
185
170
186
/// Build the template against the crates.io packages.
You can’t perform that action at this time.
0 commit comments