-
Notifications
You must be signed in to change notification settings - Fork 259
/
Copy pathfilecheck.rs
60 lines (54 loc) · 1.08 KB
/
filecheck.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
pub mod common;
use crate::common::{check_for_missing_tests_for, test_dir_for, Analyze, FileCheck};
#[test]
fn check_for_missing_tests() {
check_for_missing_tests_for(file!());
}
fn test(file_name: &str) {
let analyze = Analyze::resolve();
let file_check = FileCheck::resolve();
let path = test_dir_for(file!(), true).join(file_name);
let output_path = analyze.run(&path);
file_check.run(&path, &output_path);
}
macro_rules! define_test {
($name:ident) => {
#[test]
fn $name() {
test(concat!(stringify!($name), ".rs"));
}
};
}
macro_rules! define_tests {
($($name:ident,)*) => {
$(define_test! { $name })*
}
}
define_tests! {
addr_of,
aggregate1,
alias1,
alias2,
alias3,
alloc,
as_ptr,
call1,
cast,
catch_panic,
cell,
clone1,
extern_fn1,
fields,
field_temp,
fixed,
insertion_sort,
insertion_sort_driver,
insertion_sort_rewrites,
offset1,
offset2,
ptrptr1,
statics,
test_attrs,
trivial,
type_annotation_rewrite,
}