File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ func RunCargo(args ...string) error {
3535}
3636
3737func main () {
38+ if err := RunCargo ("run" , "-p" , "generate-header" ); err != nil {
39+ log .Fatalf ("failed to generate `wadge-sys` C header: %s" , err )
40+ }
3841 if err := Run (exec .Command (
3942 "go" ,
4043 "run" ,
Original file line number Diff line number Diff line change 1- //go:generate cargo run -p generate-header
1+ //go:build !wasm && !wasi && !wasip1 && !wasip2 && !wasm_unknown && !tinygo.wasm
22
33package wadge
44
Original file line number Diff line number Diff line change 1+ //go:build wasm || wasi || wasip1 || wasip2 || wasm_unknown || tinygo.wasm
2+
3+ package wadge
4+
5+ import "testing"
6+
7+ // RunTest simply calls `f`. This function is only defined for WebAssembly targets
8+ // to allow unit tests relying on `wadge` in native environments to compile for Wasm.
9+ func RunTest (_ * testing.T , f func ()) {
10+ f ()
11+ }
You can’t perform that action at this time.
0 commit comments