Skip to content

Commit ce6df9d

Browse files
author
Ellen Arteca
committed
merging upstream
2 parents 40fb508 + d5853bc commit ce6df9d

33 files changed

+31
-2299
lines changed

Cargo.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ libc = "0.2"
4040

4141
[dev-dependencies]
4242
colored = "2"
43-
ui_test = { path = "ui_test" }
43+
ui_test = "0.1"
4444
# Features chosen to match those required by env_logger, to avoid rebuilds
4545
regex = { version = "1.5.5", default-features = false, features = ["perf", "std"] }
4646
lazy_static = "1.4.0"

miri

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,8 @@ test|bless)
187187
export MIRI_BLESS="Gesundheit"
188188
fi
189189
# Then test, and let caller control flags.
190-
# Only in root project and ui_test as `cargo-miri` has no tests.
190+
# Only in root project as `cargo-miri` has no tests.
191191
$CARGO test $CARGO_EXTRA_FLAGS --manifest-path "$MIRIDIR"/Cargo.toml "$@"
192-
$CARGO test $CARGO_EXTRA_FLAGS --manifest-path "$MIRIDIR"/ui_test/Cargo.toml "$@"
193192
;;
194193
run)
195194
# Scan for "--target" to overwrite the "MIRI_TEST_TARGET" env var so
@@ -220,7 +219,6 @@ fmt)
220219
;;
221220
clippy)
222221
$CARGO clippy $CARGO_EXTRA_FLAGS --manifest-path "$MIRIDIR"/Cargo.toml --all-targets "$@"
223-
$CARGO clippy $CARGO_EXTRA_FLAGS --manifest-path "$MIRIDIR"/ui_test/Cargo.toml --all-targets "$@"
224222
$CARGO clippy $CARGO_EXTRA_FLAGS --manifest-path "$MIRIDIR"/cargo-miri/Cargo.toml "$@"
225223
;;
226224
cargo)

tests/compiletest.rs

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ fn build_so_for_c_ffi_tests() -> PathBuf {
3737
so_file_path
3838
}
3939

40-
fn run_tests(mode: Mode, path: &str, target: Option<String>) -> Result<()> {
40+
fn run_tests(
41+
mode: Mode,
42+
path: &str,
43+
target: Option<String>,
44+
with_dependencies: bool,
45+
) -> Result<()> {
4146
let in_rustc_test_suite = option_env!("RUSTC_STAGE").is_some();
4247

4348
// Add some flags we always want.
@@ -107,7 +112,7 @@ fn run_tests(mode: Mode, path: &str, target: Option<String>) -> Result<()> {
107112
path_filter: path_filter.collect(),
108113
program: miri_path(),
109114
output_conflict_handling,
110-
dependencies_crate_manifest_path: use_std
115+
dependencies_crate_manifest_path: (with_dependencies && use_std)
111116
.then(|| Path::new("test_dependencies").join("Cargo.toml")),
112117
dependency_builder: Some(DependencyBuilder {
113118
program: std::env::var_os("CARGO").unwrap().into(),
@@ -171,7 +176,14 @@ regexes! {
171176
r"[^ ]*/\.?cargo/registry/.*/(.*\.rs)" => "CARGO_REGISTRY/.../$1",
172177
}
173178

174-
fn ui(mode: Mode, path: &str) -> Result<()> {
179+
enum Dependencies {
180+
WithDependencies,
181+
WithoutDependencies,
182+
}
183+
184+
use Dependencies::*;
185+
186+
fn ui(mode: Mode, path: &str, with_dependencies: Dependencies) -> Result<()> {
175187
let target = get_target();
176188

177189
let msg = format!(
@@ -180,7 +192,11 @@ fn ui(mode: Mode, path: &str) -> Result<()> {
180192
);
181193
eprintln!("{}", msg.green().bold());
182194

183-
run_tests(mode, path, target)
195+
let with_dependencies = match with_dependencies {
196+
WithDependencies => true,
197+
WithoutDependencies => false,
198+
};
199+
run_tests(mode, path, target, with_dependencies)
184200
}
185201

186202
fn get_target() -> Option<String> {
@@ -195,12 +211,13 @@ fn main() -> Result<()> {
195211
// Let the tests know where to store temp files (they might run for a different target, which can make this hard to find).
196212
env::set_var("MIRI_TEMP", env::temp_dir());
197213

198-
ui(Mode::Pass, "tests/pass")?;
199-
ui(Mode::Panic, "tests/panic")?;
200-
ui(Mode::Fail, "tests/fail")?;
214+
ui(Mode::Pass, "tests/pass", WithoutDependencies)?;
215+
ui(Mode::Pass, "tests/pass-dep", WithDependencies)?;
216+
ui(Mode::Panic, "tests/panic", WithDependencies)?;
217+
ui(Mode::Fail, "tests/fail", WithDependencies)?;
201218
if cfg!(target_os = "linux") {
202-
ui(Mode::Pass, "tests/extern-so/pass")?;
203-
ui(Mode::Fail, "tests/extern-so/fail")?;
219+
ui(Mode::Pass, "tests/extern-so/pass", WithoutDependencies)?;
220+
ui(Mode::Fail, "tests/extern-so/fail", WithDependencies)?;
204221
}
205222

206223
Ok(())
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)