clippy, run subset of cli_run tests

This commit is contained in:
Anton-4 2022-11-15 20:22:24 +01:00
parent 5a447a9fcc
commit 0517d8959c
No known key found for this signature in database
GPG key ID: A13F4A6E21141925
2 changed files with 10 additions and 4 deletions

View file

@ -52,4 +52,7 @@ jobs:
run: cargo test --locked --release --no-run -p roc_ident -p roc_region -p roc_collections -p roc_can -p roc_types -p roc_solve -p roc_mono -p roc_gen_dev -p roc_gen_wasm -p roc_serialize -p roc_editor -p roc_linker -p roc_cli || cargo test --locked --release --no-run -p roc_ident -p roc_region -p roc_collections -p roc_can -p roc_types -p roc_solve -p roc_mono -p roc_gen_dev -p roc_gen_wasm -p roc_serialize -p roc_editor -p roc_linker -p roc_cli
- name: Actually run the tests.
run: cargo test --locked --release -p roc_ident -p roc_region -p roc_collections -p roc_can -p roc_types -p roc_solve -p roc_mono -p roc_gen_dev -p roc_gen_wasm -p roc_serialize -p roc_editor -p roc_linker -p roc_cli
run: cargo test --locked --release -p roc_ident -p roc_region -p roc_collections -p roc_can -p roc_types -p roc_solve -p roc_mono -p roc_gen_dev -p roc_gen_wasm -p roc_serialize -p roc_editor -p roc_linker
- name: Run roc_cli tests that work on CI
run: cargo test --locked --release -p roc_cli cli_run::fibonacci cli_run::format_check_good cli_run::format_check_reformatting_needed cli_run::platform_switching_zig cli_run::platform_switching_main

View file

@ -3,7 +3,7 @@ use snafu::OptionExt;
use std::{
collections::HashMap,
env::{self, VarError},
path::{Path, PathBuf},
path::PathBuf,
process::Command,
slice::SliceIndex,
};
@ -131,14 +131,17 @@ pub fn get_lib_path() -> Option<PathBuf> {
None
}
#[cfg(windows)]
use std::path::Path;
/// On windows, the path is prefixed with `\\?\`, the "verbatim" prefix.
/// Such a path does not works as an argument to `zig` and other command line tools,
/// and there seems to be no good way to strip it. So we resort to some string manipulation.
#[cfg(windows)]
pub fn strip_windows_prefix(path_buf: &Path) -> std::path::PathBuf {
pub fn strip_windows_prefix(path_buf: &Path) -> PathBuf {
let path_str = path_buf.display().to_string();
std::path::Path::new(path_str.trim_start_matches(r"\\?\")).to_path_buf()
Path::new(path_str.trim_start_matches(r"\\?\")).to_path_buf()
}
/// get the Path of the root of the repository