Skip to content

Commit

Permalink
8 tests are working now
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-johnson-4 committed Oct 26, 2024
1 parent c5780cc commit 2989dae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lambda_mountain"
version = "1.17.23"
version = "1.17.24"
authors = ["Andrew <andrew@subarctic.org>"]
license = "MIT"
description = "Typed Macro Assembler (backed by Coq proofs-of-correctness)"
Expand Down
29 changes: 6 additions & 23 deletions tests/regress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,15 @@ fn compile_bootstrap() {
}

fn run_bootstrap(target: &str) -> String {
rm("tmp.s");
rm("tmp.o");
rm("tmp.c");
rm("a.out");

let exit = Command::new("./bootstrap")
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::piped())
.arg("--c")
.arg("-o")
.arg("tmp.s")
.arg("tmp.c")
.arg(target)
.spawn()
.expect("failed to execute process")
Expand All @@ -65,34 +64,19 @@ fn run_bootstrap(target: &str) -> String {
+ &String::from_utf8_lossy(&exit.stderr).to_string();
};
if output=="" {
let exit = Command::new("as")
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::piped())
.arg("-o")
.arg("tmp.o")
.arg("tmp.s")
.spawn()
.expect("failed to execute process")
.wait_with_output()
.expect("failed to wait for process");
if !exit.status.success() {
let stderr = String::from_utf8_lossy(&exit.stderr).to_string();
return format!("as error code: {} on target {}", stderr, target);
};

let exit = Command::new("ld")
let exit = Command::new("cc")
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::piped())
.arg("-o")
.arg("a.out")
.arg("tmp.o")
.arg("tmp.c")
.spawn()
.expect("failed to execute process")
.wait_with_output()
.expect("failed to wait for process");
if !exit.status.success() {
let stderr = String::from_utf8_lossy(&exit.stderr).to_string();
return format!("ld error code: {} on target {}", stderr, target);
return format!("cc error code: {} on target {}", stderr, target);
};
let exit = Command::new("timeout")
.stdout(std::process::Stdio::piped())
Expand All @@ -110,8 +94,7 @@ fn run_bootstrap(target: &str) -> String {
+ &String::from_utf8_lossy(&exit.stderr).to_string()
};
}
rm("tmp.s");
rm("tmp.o");
rm("tmp.c");
rm("a.out");
output
}
Expand Down

0 comments on commit 2989dae

Please sign in to comment.