about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/run-make/CURRENT_RUSTC_VERSION/Makefile6
-rw-r--r--tests/run-make/CURRENT_RUSTC_VERSION/rmake.rs27
-rw-r--r--tests/run-make/a-b-a-linker-guard/Makefile16
-rw-r--r--tests/run-make/a-b-a-linker-guard/rmake.rs45
4 files changed, 72 insertions, 22 deletions
diff --git a/tests/run-make/CURRENT_RUSTC_VERSION/Makefile b/tests/run-make/CURRENT_RUSTC_VERSION/Makefile
deleted file mode 100644
index 7940dae207b..00000000000
--- a/tests/run-make/CURRENT_RUSTC_VERSION/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-include ../tools.mk
-
-all:
-	$(RUSTC) --emit=metadata --crate-type lib stable.rs
-	$(RUSTC) --emit=metadata --extern stable=$(TMPDIR)/libstable.rmeta main.rs 2>&1 >/dev/null \
-		| $(CGREP) -e "stable since $$(cat $(S)/src/version)(-[a-zA-Z]+)?"
diff --git a/tests/run-make/CURRENT_RUSTC_VERSION/rmake.rs b/tests/run-make/CURRENT_RUSTC_VERSION/rmake.rs
new file mode 100644
index 00000000000..586f4e4095f
--- /dev/null
+++ b/tests/run-make/CURRENT_RUSTC_VERSION/rmake.rs
@@ -0,0 +1,27 @@
+// ignore-tidy-linelength
+
+extern crate run_make_support;
+
+use std::path::PathBuf;
+
+use run_make_support::{aux_build, rustc};
+
+fn main() {
+    aux_build()
+        .arg("--emit=metadata")
+        .arg("stable.rs")
+        .run();
+    let mut stable_path = PathBuf::from(env!("TMPDIR"));
+    stable_path.push("libstable.rmeta");
+    let output = rustc()
+        .arg("--emit=metadata")
+        .arg("--extern")
+        .arg(&format!("stable={}", &stable_path.to_string_lossy()))
+        .arg("main.rs")
+        .run();
+
+    let stderr = String::from_utf8_lossy(&output.stderr);
+    let version = include_str!(concat!(env!("S"), "/src/version"));
+    let expected_string = format!("stable since {}", version.trim());
+    assert!(stderr.contains(&expected_string));
+}
diff --git a/tests/run-make/a-b-a-linker-guard/Makefile b/tests/run-make/a-b-a-linker-guard/Makefile
deleted file mode 100644
index 43282eae09c..00000000000
--- a/tests/run-make/a-b-a-linker-guard/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-# Test that if we build `b` against a version of `a` that has one set
-# of types, it will not run with a dylib that has a different set of
-# types.
-
-# NOTE(eddyb) this test only works with the `legacy` mangling,
-# and will probably get removed once `legacy` is gone.
-
-all:
-	$(RUSTC) a.rs --cfg x -C prefer-dynamic -Z unstable-options -C symbol-mangling-version=legacy
-	$(RUSTC) b.rs -C prefer-dynamic -Z unstable-options -C symbol-mangling-version=legacy
-	$(call RUN,b)
-	$(RUSTC) a.rs --cfg y -C prefer-dynamic -Z unstable-options -C symbol-mangling-version=legacy
-	$(call FAIL,b)
diff --git a/tests/run-make/a-b-a-linker-guard/rmake.rs b/tests/run-make/a-b-a-linker-guard/rmake.rs
new file mode 100644
index 00000000000..ef4813e1214
--- /dev/null
+++ b/tests/run-make/a-b-a-linker-guard/rmake.rs
@@ -0,0 +1,45 @@
+// ignore-tidy-linelength
+
+extern crate run_make_support;
+
+use run_make_support::{run, run_fail, rustc};
+
+fn main() {
+    rustc()
+        .arg("a.rs")
+        .arg("--cfg")
+        .arg("x")
+        .arg("-C")
+        .arg("prefer-dynamic")
+        .arg("-Z")
+        .arg("unstable-options")
+        .arg("-C")
+        .arg("symbol-mangling-version=legacy")
+        .run();
+
+    rustc()
+       .arg("b.rs")
+       .arg("-C")
+       .arg("prefer-dynamic")
+       .arg("-Z")
+       .arg("unstable-options")
+       .arg("-C")
+       .arg("symbol-mangling-version=legacy")
+       .run();
+
+    run("b");
+
+    rustc()
+        .arg("a.rs")
+        .arg("--cfg")
+        .arg("y")
+        .arg("-C")
+        .arg("prefer-dynamic")
+        .arg("-Z")
+        .arg("unstable-options")
+        .arg("-C")
+        .arg("symbol-mangling-version=legacy")
+        .run();
+
+    run_fail("b");
+}