aboutsummaryrefslogtreecommitdiff
path: root/cc/tests/test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cc/tests/test.rs')
-rw-r--r--cc/tests/test.rs41
1 files changed, 10 insertions, 31 deletions
diff --git a/cc/tests/test.rs b/cc/tests/test.rs
index 5147b77..74eca1e 100644
--- a/cc/tests/test.rs
+++ b/cc/tests/test.rs
@@ -1,7 +1,6 @@
extern crate cc;
extern crate tempdir;
-use std::env;
use support::Test;
mod support;
@@ -112,26 +111,6 @@ fn gnu_warnings_overridable() {
}
#[test]
-fn gnu_no_warnings_if_cflags() {
- env::set_var("CFLAGS", "-Wflag-does-not-exist");
- let test = Test::gnu();
- test.gcc().file("foo.c").compile("foo");
-
- test.cmd(0).must_not_have("-Wall").must_not_have("-Wextra");
- env::set_var("CFLAGS", "");
-}
-
-#[test]
-fn gnu_no_warnings_if_cxxflags() {
- env::set_var("CXXFLAGS", "-Wflag-does-not-exist");
- let test = Test::gnu();
- test.gcc().file("foo.c").compile("foo");
-
- test.cmd(0).must_not_have("-Wall").must_not_have("-Wextra");
- env::set_var("CXXFLAGS", "");
-}
-
-#[test]
fn gnu_x86_64() {
for vendor in &["unknown-linux-gnu", "apple-darwin"] {
let target = format!("x86_64-{}", vendor);
@@ -311,11 +290,11 @@ fn msvc_smoke() {
test.gcc().file("foo.c").compile("foo");
test.cmd(0)
- .must_have("/O2")
+ .must_have("-O2")
.must_have("foo.c")
- .must_not_have("/Z7")
- .must_have("/c")
- .must_have("/MD");
+ .must_not_have("-Z7")
+ .must_have("-c")
+ .must_have("-MD");
test.cmd(1).must_have(test.td.path().join("foo.o"));
}
@@ -324,14 +303,14 @@ fn msvc_opt_level_0() {
let test = Test::msvc();
test.gcc().opt_level(0).file("foo.c").compile("foo");
- test.cmd(0).must_not_have("/O2");
+ test.cmd(0).must_not_have("-O2");
}
#[test]
fn msvc_debug() {
let test = Test::msvc();
test.gcc().debug(true).file("foo.c").compile("foo");
- test.cmd(0).must_have("/Z7");
+ test.cmd(0).must_have("-Z7");
}
#[test]
@@ -339,7 +318,7 @@ fn msvc_include() {
let test = Test::msvc();
test.gcc().include("foo/bar").file("foo.c").compile("foo");
- test.cmd(0).must_have("/I").must_have("foo/bar");
+ test.cmd(0).must_have("-I").must_have("foo/bar");
}
#[test]
@@ -351,7 +330,7 @@ fn msvc_define() {
.file("foo.c")
.compile("foo");
- test.cmd(0).must_have("/DFOO=bar").must_have("/DBAR");
+ test.cmd(0).must_have("-DFOO=bar").must_have("-DBAR");
}
#[test]
@@ -359,7 +338,7 @@ fn msvc_static_crt() {
let test = Test::msvc();
test.gcc().static_crt(true).file("foo.c").compile("foo");
- test.cmd(0).must_have("/MT");
+ test.cmd(0).must_have("-MT");
}
#[test]
@@ -367,5 +346,5 @@ fn msvc_no_static_crt() {
let test = Test::msvc();
test.gcc().static_crt(false).file("foo.c").compile("foo");
- test.cmd(0).must_have("/MD");
+ test.cmd(0).must_have("-MD");
}