]> git.lizzy.rs Git - rust.git/commitdiff
Improve error message in make_tests
authorPhilip Munksgaard <pmunksgaard@gmail.com>
Wed, 13 Nov 2019 11:44:43 +0000 (12:44 +0100)
committerGitHub <noreply@github.com>
Wed, 13 Nov 2019 11:44:43 +0000 (12:44 +0100)
We should use expect instead of unwrap.

This commit is based on https://github.com/laumann/compiletest-rs/pull/58. Thanks to @colin-kiegel.

src/tools/compiletest/src/main.rs

index b115539b4af3b2e61cd140fd5877a026113a11ab..9bf427953a15302c006bd799519bfcd108b8c48a 100644 (file)
@@ -581,7 +581,7 @@ pub fn make_tests(config: &Config) -> Vec<test::TestDescAndFn> {
         &config.src_base,
         &PathBuf::new(),
         &mut tests,
-    ).unwrap();
+    ).expect(&format!("Could not read tests from {}", config.src_base.display()));
     tests
 }