mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-06 12:48:20 +00:00
Invoke exa via Rust since it doesn't seem to be working with Makefiles
This commit is contained in:
@@ -271,6 +271,8 @@ fn test_run() {
|
||||
|
||||
println!("compiling {test}: {command:?}");
|
||||
|
||||
print_wasmer_root_to_stdout(&config);
|
||||
|
||||
// compile
|
||||
let output = command
|
||||
.output()
|
||||
@@ -278,6 +280,7 @@ fn test_run() {
|
||||
if !output.status.success() {
|
||||
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
|
||||
println!("stdout: {}", String::from_utf8_lossy(&output.stderr));
|
||||
print_wasmer_root_to_stdout(&config);
|
||||
panic!("failed to compile {test}");
|
||||
}
|
||||
|
||||
@@ -293,6 +296,7 @@ fn test_run() {
|
||||
if !output.status.success() {
|
||||
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
|
||||
println!("stdout: {}", String::from_utf8_lossy(&output.stderr));
|
||||
print_wasmer_root_to_stdout(&config);
|
||||
panic!("failed to execute {test}");
|
||||
}
|
||||
}
|
||||
@@ -365,6 +369,36 @@ fn test_run() {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn print_wasmer_root_to_stdout(config: &Config) {
|
||||
println!("print_wasmer_root_to_stdout");
|
||||
|
||||
let mut cmd = std::process::Command::new("cargo");
|
||||
cmd.arg("install");
|
||||
cmd.arg("exa");
|
||||
let _ = cmd.output().unwrap();
|
||||
|
||||
println!("exa installed, listing wasmer dir");
|
||||
|
||||
let mut cmd = std::process::Command::new("exa");
|
||||
cmd.arg("--tree");
|
||||
cmd.arg(&config.wasmer_dir);
|
||||
let o = cmd.output().unwrap();
|
||||
println!("{}", String::from_utf8_lossy(&o.stdout));
|
||||
println!("{}", String::from_utf8_lossy(&o.stderr));
|
||||
|
||||
println!("exa installed, listing root dir");
|
||||
|
||||
let mut cmd = std::process::Command::new("exa");
|
||||
cmd.arg("--tree");
|
||||
cmd.arg(&config.root_dir);
|
||||
let o = cmd.output().unwrap();
|
||||
println!("{}", String::from_utf8_lossy(&o.stdout));
|
||||
println!("{}", String::from_utf8_lossy(&o.stderr));
|
||||
|
||||
println!("printed");
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn fixup_symlinks(include_paths: &[String], log: &mut String) -> Result<(), Box<dyn Error>> {
|
||||
log.push_str(&format!("include paths: {include_paths:?}"));
|
||||
|
||||
@@ -356,6 +356,8 @@ fn test_ok() {
|
||||
command.arg("-o");
|
||||
command.arg(&format!("{manifest_dir}/../{test}"));
|
||||
|
||||
print_wasmer_root_to_stdout(&config);
|
||||
|
||||
// compile
|
||||
let output = command
|
||||
.output()
|
||||
@@ -363,6 +365,7 @@ fn test_ok() {
|
||||
if !output.status.success() {
|
||||
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
|
||||
println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
|
||||
print_wasmer_root_to_stdout(&config);
|
||||
panic!("failed to compile {test}: {command:#?}");
|
||||
}
|
||||
|
||||
@@ -376,13 +379,7 @@ fn test_ok() {
|
||||
if !output.status.success() {
|
||||
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
|
||||
println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
|
||||
println!("listing {manifest_dir}/../{test}:");
|
||||
if let Ok(r) = std::fs::read_dir(&format!("{manifest_dir}/../")) {
|
||||
for entry in r {
|
||||
let entry = entry.unwrap();
|
||||
println!(" {entry:?}");
|
||||
}
|
||||
}
|
||||
print_wasmer_root_to_stdout(&config);
|
||||
panic!("failed to execute {test}: {command:#?}");
|
||||
}
|
||||
}
|
||||
@@ -395,6 +392,36 @@ fn test_ok() {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn print_wasmer_root_to_stdout(config: &Config) {
|
||||
println!("print_wasmer_root_to_stdout");
|
||||
|
||||
let mut cmd = std::process::Command::new("cargo");
|
||||
cmd.arg("install");
|
||||
cmd.arg("exa");
|
||||
let _ = cmd.output().unwrap();
|
||||
|
||||
println!("exa installed, listing wasmer dir");
|
||||
|
||||
let mut cmd = std::process::Command::new("exa");
|
||||
cmd.arg("--tree");
|
||||
cmd.arg(&config.wasmer_dir);
|
||||
let o = cmd.output().unwrap();
|
||||
println!("{}", String::from_utf8_lossy(&o.stdout));
|
||||
println!("{}", String::from_utf8_lossy(&o.stderr));
|
||||
|
||||
println!("exa installed, listing root dir");
|
||||
|
||||
let mut cmd = std::process::Command::new("exa");
|
||||
cmd.arg("--tree");
|
||||
cmd.arg(&config.root_dir);
|
||||
let o = cmd.output().unwrap();
|
||||
println!("{}", String::from_utf8_lossy(&o.stdout));
|
||||
println!("{}", String::from_utf8_lossy(&o.stderr));
|
||||
|
||||
println!("printed");
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn fixup_symlinks(include_paths: &[String], log: &mut String) -> Result<(), Box<dyn Error>> {
|
||||
log.push_str(&format!("include paths: {include_paths:?}"));
|
||||
|
||||
Reference in New Issue
Block a user