1 extern crate tempdir;
2 extern crate gcc;
3 
4 use std::env;
5 
6 mod support;
7 use support::Test;
8 
9 #[test]
main()10 fn main() {
11     ccache();
12     distcc();
13     ccache_spaces();
14 }
15 
ccache()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 
ccache_spaces()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 
distcc()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 }
50