diff options
author | 2021-12-26 10:43:57 +0100 | |
---|---|---|
committer | 2021-12-26 11:05:35 +0100 | |
commit | ef4e4aaaa3d261bda0aa46f89f2e6f8edefd202e (patch) | |
tree | c4866ab5e4d57f7bbf8108937f8a120367acef21 /xtask/src/build.rs | |
parent | bc883e393db2e07f3519993abae0248e3584cbef (diff) | |
download | rtic-ef4e4aaaa3d261bda0aa46f89f2e6f8edefd202e.tar.gz rtic-ef4e4aaaa3d261bda0aa46f89f2e6f8edefd202e.tar.zst rtic-ef4e4aaaa3d261bda0aa46f89f2e6f8edefd202e.zip |
cargo xtask is now ~40x faster
Diffstat (limited to 'xtask/src/build.rs')
-rw-r--r-- | xtask/src/build.rs | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/xtask/src/build.rs b/xtask/src/build.rs index 904e9177..148a9fde 100644 --- a/xtask/src/build.rs +++ b/xtask/src/build.rs @@ -1,9 +1,4 @@ -use std::{ - fs, - path::{Path, PathBuf}, -}; - -use crate::{command::BuildMode, TestRunError}; +use std::{fs, path::Path}; const HEX_BUILD_ROOT: &str = "ci/builds"; @@ -16,38 +11,3 @@ pub fn init_build_dir() -> anyhow::Result<()> { fs::create_dir_all(HEX_BUILD_ROOT) .map_err(|_| anyhow::anyhow!("Could not create directory: {}", HEX_BUILD_ROOT)) } - -pub fn build_hexpath( - example: &str, - features: Option<&str>, - build_mode: BuildMode, - build_num: u32, -) -> anyhow::Result<String> { - let features = match features { - Some(f) => f, - None => "", - }; - - let filename = format!("{}_{}_{}_{}.hex", example, features, build_mode, build_num); - - let mut path = PathBuf::from(HEX_BUILD_ROOT); - path.push(filename); - - path.into_os_string() - .into_string() - .map_err(|e| anyhow::Error::new(TestRunError::PathConversionError(e))) -} - -pub fn compare_builds(expected: String, got: String) -> anyhow::Result<()> { - let buf_1 = std::fs::read_to_string(expected.clone())?; - let buf_2 = std::fs::read_to_string(got.clone())?; - - if buf_1 != buf_2 { - return Err(anyhow::Error::new(TestRunError::FileCmpError { - expected, - got, - })); - } - - Ok(()) -} |