(runner: &mut Runner, compiler: PathBuf)
| 81 | } |
| 82 | |
| 83 | fn prepare(runner: &mut Runner, compiler: PathBuf) -> Result<()> { |
| 84 | let cwd = env::current_dir()?; |
| 85 | let dir = cwd.join(&runner.opts.artifacts).join("c"); |
| 86 | |
| 87 | super::write_if_different(&dir.join("test.c"), "int main() { return 0; }")?; |
| 88 | |
| 89 | println!("Testing if `{}` works...", compiler.display()); |
| 90 | runner |
| 91 | .run_command(Command::new(&compiler).current_dir(&dir).arg("test.c")) |
| 92 | .inspect_err(|_| { |
| 93 | eprintln!( |
| 94 | "Error: failed to find `{}`. Hint: pass `--wasi-sdk-path` or set `WASI_SDK_PATH`", |
| 95 | compiler.display() |
| 96 | ); |
| 97 | })?; |
| 98 | |
| 99 | Ok(()) |
| 100 | } |
| 101 | |
| 102 | fn compile(runner: &Runner, compile: &Compile<'_>, compiler: PathBuf) -> Result<()> { |
| 103 | let config = compile.component.deserialize_lang_config::<LangConfig>()?; |
no test coverage detected