aboutsummaryrefslogtreecommitdiff
path: root/gcc/tests/cc_env.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2017-03-26 17:07:27 -0700
committerDaniel Mueller <deso@posteo.net>2017-03-26 17:07:27 -0700
commit86415f23a86b5a44aa000d513500a9d1d0df4bba (patch)
tree5a9c513c9531414502de67dda322fca9baac7563 /gcc/tests/cc_env.rs
parent547085cdefb3372e8c42beabac5d45f2f6b1a535 (diff)
downloadnitrocli-86415f23a86b5a44aa000d513500a9d1d0df4bba.tar.gz
nitrocli-86415f23a86b5a44aa000d513500a9d1d0df4bba.tar.bz2
Import subrepo gcc/:gcc at cf1f00bc038a0df769e14bb85480ab9c12eae08d
Diffstat (limited to 'gcc/tests/cc_env.rs')
-rw-r--r--gcc/tests/cc_env.rs49
1 files changed, 49 insertions, 0 deletions
diff --git a/gcc/tests/cc_env.rs b/gcc/tests/cc_env.rs
new file mode 100644
index 0000000..559dbe8
--- /dev/null
+++ b/gcc/tests/cc_env.rs
@@ -0,0 +1,49 @@
+extern crate tempdir;
+extern crate gcc;
+
+use std::env;
+
+mod support;
+use support::Test;
+
+#[test]
+fn main() {
+ ccache();
+ distcc();
+ ccache_spaces();
+}
+
+fn ccache() {
+ let test = Test::gnu();
+ test.shim("ccache");
+
+ env::set_var("CC", "ccache lol-this-is-not-a-compiler foo");
+ test.gcc().file("foo.c").compile("libfoo.a");
+
+ test.cmd(0)
+ .must_have("lol-this-is-not-a-compiler foo")
+ .must_have("foo.c")
+ .must_not_have("ccache");
+}
+
+fn ccache_spaces() {
+ let test = Test::gnu();
+ test.shim("ccache");
+
+ env::set_var("CC", "ccache lol-this-is-not-a-compiler foo");
+ test.gcc().file("foo.c").compile("libfoo.a");
+ test.cmd(0).must_have("lol-this-is-not-a-compiler foo");
+}
+
+fn distcc() {
+ let test = Test::gnu();
+ test.shim("distcc");
+
+ env::set_var("CC", "distcc lol-this-is-not-a-compiler foo");
+ test.gcc().file("foo.c").compile("libfoo.a");
+
+ test.cmd(0)
+ .must_have("lol-this-is-not-a-compiler foo")
+ .must_have("foo.c")
+ .must_not_have("distcc");
+}