File tree 1 file changed +42
-0
lines changed 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ fn std_lib() {
37
37
hashbrown ( ) ;
38
38
libc ( ) ;
39
39
test ( ) ;
40
+ custom_test_framework ( ) ;
40
41
target_proc_macro ( ) ;
41
42
bench ( ) ;
42
43
doc ( ) ;
@@ -186,6 +187,47 @@ fn test() {
186
187
. run ( ) ;
187
188
}
188
189
190
+ fn custom_test_framework ( ) {
191
+ let p = project ( )
192
+ . file (
193
+ "src/lib.rs" ,
194
+ r#"
195
+ #![no_std]
196
+ #![cfg_attr(test, no_main)]
197
+ #![feature(custom_test_frameworks)]
198
+ #![test_runner(crate::test_runner)]
199
+
200
+ pub fn test_runner(_tests: &[&dyn Fn()]) {}
201
+
202
+ #[panic_handler]
203
+ fn panic(_info: &core::panic::PanicInfo) -> ! {
204
+ loop {}
205
+ }
206
+ "# ,
207
+ )
208
+ . file (
209
+ "target.json" ,
210
+ r#"
211
+ {
212
+ "llvm-target": "x86_64-unknown-none-gnu",
213
+ "data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
214
+ "arch": "x86_64",
215
+ "target-endian": "little",
216
+ "target-pointer-width": "64",
217
+ "target-c-int-width": "32",
218
+ "os": "none",
219
+ "linker-flavor": "ld.lld",
220
+ "linker": "rust-lld",
221
+ "executables": true,
222
+ "panic-strategy": "abort"
223
+ }
224
+ "# ,
225
+ )
226
+ . build ( ) ;
227
+
228
+ cargo_build_std ( & p, "test --target target.json --no-run -v" , "core" ) . run ( ) ;
229
+ }
230
+
189
231
fn target_proc_macro ( ) {
190
232
let p = project ( )
191
233
. file (
You can’t perform that action at this time.
0 commit comments