/
test_crates.rs
69 lines (61 loc) · 1.35 KB
/
test_crates.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
61
62
63
64
65
66
67
68
69
//! Run the programs in the `test-crates` directory and compare their
//! outputs with expected outputs.
mod utils;
fn test_crate(
name: &str,
args: &[&str],
envs: &[(&str, &str)],
stdout: &'static str,
stderr: &'static str,
code: Option<i32>,
) {
utils::test_crate("test", "run", name, args, envs, stdout, stderr, code);
}
#[test]
fn test_tls() {
test_crate(
"origin-start",
&["--bin=tls", "--release"],
&[],
"",
"",
Some(200),
);
}
#[test]
fn test_tls_crt_static() {
test_crate(
"origin-start",
&["--bin=tls", "--features=origin/experimental-relocate"],
&[("RUSTFLAGS", "-C target-feature=+crt-static")],
"",
"",
Some(200),
);
}
#[test]
fn test_tls_crt_static_relocation_static() {
test_crate(
"origin-start",
&["--bin=tls"],
&[(
"RUSTFLAGS",
"-C target-feature=+crt-static -C relocation-model=static",
)],
"",
"",
Some(200),
);
}
#[test]
fn test_thread_id() {
test_crate("origin-start", &["--bin=thread-id"], &[], "", "", Some(201));
}
#[test]
fn test_detach() {
test_crate("origin-start", &["--bin=detach"], &[], "", "", Some(202));
}
#[test]
fn test_canary() {
test_crate("origin-start", &["--bin=canary"], &[], "", "", Some(203));
}