mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
cli_run test fixes
This commit is contained in:
parent
076190a217
commit
1d9a751606
4 changed files with 19 additions and 4 deletions
|
@ -10,7 +10,7 @@ extern crate roc_module;
|
|||
#[cfg(test)]
|
||||
mod cli_run {
|
||||
use cli_utils::helpers::{
|
||||
example_file, examples_dir, extract_valgrind_errors, fixture_file, fixtures_dir,
|
||||
example_file, examples_dir, cli_testing_dir, extract_valgrind_errors, fixture_file, fixtures_dir,
|
||||
known_bad_file, run_cmd, run_roc, run_with_valgrind, strip_colors, Out, ValgrindError,
|
||||
ValgrindErrorXWhat,
|
||||
};
|
||||
|
@ -115,6 +115,7 @@ mod cli_run {
|
|||
stdin: &[&str],
|
||||
app_args: &[String],
|
||||
) -> Out {
|
||||
dbg!(file);
|
||||
let compile_out = run_roc(
|
||||
// converting these all to String avoids lifetime issues
|
||||
args.into_iter()
|
||||
|
@ -584,7 +585,7 @@ mod cli_run {
|
|||
// expected_ending: "successfully wrote to file\n",
|
||||
// use_valgrind: true,
|
||||
// },
|
||||
false_interpreter:"false-interpreter" => {
|
||||
false_interpreter:"cli/false-interpreter" => {
|
||||
Example {
|
||||
filename: "False.roc",
|
||||
executable_filename: "false",
|
||||
|
@ -623,7 +624,7 @@ mod cli_run {
|
|||
#[cfg(all(not(feature = "wasm32-cli-run"), not(feature = "i386-cli-run")))]
|
||||
fn $test_name() {
|
||||
let benchmark = $benchmark;
|
||||
let file_name = examples_dir("benchmarks").join(benchmark.filename);
|
||||
let file_name = cli_testing_dir("benchmarks").join(benchmark.filename);
|
||||
|
||||
// TODO fix QuicksortApp and then remove this!
|
||||
match benchmark.filename {
|
||||
|
|
|
@ -359,6 +359,19 @@ pub fn root_dir() -> PathBuf {
|
|||
path
|
||||
}
|
||||
|
||||
// start the dir with crates/cli_testing_examples
|
||||
#[allow(dead_code)]
|
||||
pub fn cli_testing_dir(dir_name: &str) -> PathBuf {
|
||||
let mut path = root_dir();
|
||||
|
||||
// Descend into examples/{dir_name}
|
||||
path.push("crates");
|
||||
path.push("cli_testing_examples");
|
||||
path.extend(dir_name.split("/")); // Make slashes cross-target
|
||||
|
||||
path
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn examples_dir(dir_name: &str) -> PathBuf {
|
||||
let mut path = root_dir();
|
||||
|
|
|
@ -635,6 +635,7 @@ pub fn rebuild_host(
|
|||
} else if cargo_host_src.exists() {
|
||||
// Compile and link Cargo.toml, if it exists
|
||||
let cargo_dir = host_input_path.parent().unwrap();
|
||||
|
||||
let cargo_out_dir = cargo_dir.join("target").join(
|
||||
if matches!(opt_level, OptLevel::Optimize | OptLevel::Size) {
|
||||
"release"
|
||||
|
|
|
@ -17,7 +17,7 @@ name = "host"
|
|||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
roc_std = { path = "../../../crates/roc_std" }
|
||||
roc_std = { path = "../../../../crates/roc_std" }
|
||||
libc = "0.2"
|
||||
|
||||
[workspace]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue