diff --git a/src/main.rs b/src/main.rs index 9e172c4b..dd7e0663 100644 --- a/src/main.rs +++ b/src/main.rs @@ -318,7 +318,7 @@ fn compile_executable(file_name: &str, host: &host::Host) -> Result<(), io::Erro } let output = process::Command::new("cargo") - .current_dir(".hvm") + .current_dir("./.hvm") .arg("build") .arg("--release") .stderr(Stdio::inherit()) @@ -327,9 +327,8 @@ fn compile_executable(file_name: &str, host: &host::Host) -> Result<(), io::Erro process::exit(1); } - let target = format!("{}", file_name.strip_suffix(".hvmc").unwrap_or(file_name)); - - fs::copy(".hvm/target/release/hvmc", target)?; + let target = format!("./{}", file_name.strip_suffix(".hvmc").unwrap_or(file_name)); + fs::copy("./.hvm/target/release/hvmc", target)?; Ok(()) } diff --git a/tests/cli.rs b/tests/cli.rs index 9c3a6798..40bf8c67 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -3,7 +3,6 @@ use std::{ error::Error, io::Read, - path::PathBuf, process::{Command, ExitStatus, Stdio}, }; @@ -184,36 +183,3 @@ fn test_apply_tree() { @"(<2* a> a)" ); } - -#[test] -fn test_cli_compile() { - // Test normal-form expressions - - if !Command::new(env!("CARGO_BIN_EXE_hvmc")) - .args(&["compile", &get_arithmetic_program_path()]) - .stdout(Stdio::inherit()) - .stderr(Stdio::inherit()) - .spawn() - .unwrap() - .wait() - .unwrap() - .success() - { - panic!("{:?}", "compilation failed"); - }; - - let mut output_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - output_path.push("examples/arithmetic"); - let mut child = Command::new(&output_path).args(&["#40", "#3"]).stdout(Stdio::piped()).spawn().unwrap(); - - let mut stdout = child.stdout.take().ok_or("Couldn't capture stdout!").unwrap(); - child.wait().unwrap(); - let mut output = String::new(); - stdout.read_to_string(&mut output).unwrap(); - - assert_display_snapshot!(output, @r###" - [#13 #1] - "###); - - std::fs::remove_file(&output_path).unwrap(); -}