]> git.proxmox.com Git - cargo.git/blob - vendor/cc-1.0.0/tests/cc_env.rs
New upstream version 0.23.0
[cargo.git] / vendor / cc-1.0.0 / tests / cc_env.rs
1 extern crate tempdir;
2 extern crate cc;
3
4 use std::env;
5
6 mod support;
7 use support::Test;
8
9 #[test]
10 fn main() {
11 ccache();
12 distcc();
13 ccache_spaces();
14 }
15
16 fn ccache() {
17 let test = Test::gnu();
18 test.shim("ccache");
19
20 env::set_var("CC", "ccache lol-this-is-not-a-compiler foo");
21 test.gcc().file("foo.c").compile("libfoo.a");
22
23 test.cmd(0)
24 .must_have("lol-this-is-not-a-compiler foo")
25 .must_have("foo.c")
26 .must_not_have("ccache");
27 }
28
29 fn ccache_spaces() {
30 let test = Test::gnu();
31 test.shim("ccache");
32
33 env::set_var("CC", "ccache lol-this-is-not-a-compiler foo");
34 test.gcc().file("foo.c").compile("libfoo.a");
35 test.cmd(0).must_have("lol-this-is-not-a-compiler foo");
36 }
37
38 fn distcc() {
39 let test = Test::gnu();
40 test.shim("distcc");
41
42 env::set_var("CC", "distcc lol-this-is-not-a-compiler foo");
43 test.gcc().file("foo.c").compile("libfoo.a");
44
45 test.cmd(0)
46 .must_have("lol-this-is-not-a-compiler foo")
47 .must_have("foo.c")
48 .must_not_have("distcc");
49 }