diff options
author | 2022-01-12 01:46:31 +0000 | |
---|---|---|
committer | 2022-01-12 01:51:00 +0000 | |
commit | f868247e5de24348e812df7cd324b26e5f8ceda0 (patch) | |
tree | 5146b9ce32ffed2b3baa6b6f3ac3fa88de50db61 | |
parent | 91f69a92f347d76402c04a590e515f0e83355acb (diff) | |
download | cortex-m-f868247e5de24348e812df7cd324b26e5f8ceda0.tar.gz cortex-m-f868247e5de24348e812df7cd324b26e5f8ceda0.tar.zst cortex-m-f868247e5de24348e812df7cd324b26e5f8ceda0.zip |
Fix cortex-m-rt compiletest tests
-rw-r--r-- | cortex-m-rt/Cargo.toml | 4 | ||||
-rw-r--r-- | cortex-m-rt/tests/compile-fail/non-static-resource.rs | 1 | ||||
-rw-r--r-- | cortex-m-rt/tests/compiletest.rs | 6 |
3 files changed, 4 insertions, 7 deletions
diff --git a/cortex-m-rt/Cargo.toml b/cortex-m-rt/Cargo.toml index 8e4de1f..be5f5fc 100644 --- a/cortex-m-rt/Cargo.toml +++ b/cortex-m-rt/Cargo.toml @@ -18,8 +18,6 @@ links = "cortex-m-rt" # Prevent multiple versions of cortex-m-rt being linked [dependencies] cortex-m-rt-macros = { path = "macros", version = "=0.7.0" } -# Note: Do not depend on `cortex-m` here. This crate is used for testing `cortex-m`, so we need to -# avoid pulling in multiple versions of `cortex-m`. [dev-dependencies] cortex-m = { version = "0.7.4", path = ".." } @@ -27,7 +25,7 @@ panic-halt = "0.2.0" cortex-m-semihosting = "0.3" [target.'cfg(not(target_os = "none"))'.dev-dependencies] -compiletest_rs = "0.4.0" +compiletest_rs = "0.7" [[example]] name = "device" diff --git a/cortex-m-rt/tests/compile-fail/non-static-resource.rs b/cortex-m-rt/tests/compile-fail/non-static-resource.rs index ae009a9..970bbae 100644 --- a/cortex-m-rt/tests/compile-fail/non-static-resource.rs +++ b/cortex-m-rt/tests/compile-fail/non-static-resource.rs @@ -6,7 +6,6 @@ #![no_std] #![no_main] -extern crate cortex_m; extern crate cortex_m_rt; extern crate panic_halt; diff --git a/cortex-m-rt/tests/compiletest.rs b/cortex-m-rt/tests/compiletest.rs index ba2ef73..cf63d22 100644 --- a/cortex-m-rt/tests/compiletest.rs +++ b/cortex-m-rt/tests/compiletest.rs @@ -7,11 +7,11 @@ fn run_mode(mode: &'static str) { config.mode = mode.parse().expect("Invalid mode"); config.src_base = PathBuf::from(format!("tests/{}", mode)); - // config.link_deps(); // Populate config.target_rustcflags with dependencies on the path config.target_rustcflags = Some( - "-L target/debug -L target/debug/deps -C panic=abort --cfg feature=\"device\"".to_owned(), + "-L ../target/debug -L ../target/debug/deps -C panic=abort --cfg feature=\"device\"" + .to_owned(), ); - // config.clean_rmeta(); // If your tests import the parent crate, this helps with E0464 + config.clean_rmeta(); // If your tests import the parent crate, this helps with E0464 compiletest::run_tests(&config); } |