(&self, runner: &mut Runner)
| 38 | } |
| 39 | |
| 40 | fn prepare(&self, runner: &mut Runner) -> Result<()> { |
| 41 | let cwd = env::current_dir()?; |
| 42 | let dir = cwd.join(&runner.opts.artifacts).join("go"); |
| 43 | let bindings_dir = cwd.join("wit_component"); |
| 44 | |
| 45 | super::write_if_different(&dir.join("test.go"), "package main\n\nfunc main() {}")?; |
| 46 | super::write_if_different(&dir.join("go.mod"), "module test\n\ngo 1.25")?; |
| 47 | |
| 48 | replace_bindings_go_mod(runner, &bindings_dir)?; |
| 49 | |
| 50 | println!("Testing if `go build` works..."); |
| 51 | runner.run_command( |
| 52 | Command::new("go") |
| 53 | .current_dir(&dir) |
| 54 | .env("GOOS", "wasip1") |
| 55 | .env("GOARCH", "wasm") |
| 56 | .arg("build") |
| 57 | .arg("-buildmode=c-shared") |
| 58 | .arg("-ldflags=-checklinkname=0"), |
| 59 | ) |
| 60 | } |
| 61 | |
| 62 | fn compile(&self, runner: &Runner, compile: &Compile<'_>) -> Result<()> { |
| 63 | let output = compile.output.with_extension("core.wasm"); |
nothing calls this directly
no test coverage detected