-
Notifications
You must be signed in to change notification settings - Fork 5
Add more test programs #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,3 +19,4 @@ | |
| *~ | ||
|
|
||
| testdata/rust/*/target/* | ||
| testdata/.sysroot/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [submodule "wasi-libc"] | ||
| path = testdata/.wasi-libc | ||
| url = https://github.com/WebAssembly/wasi-libc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| .PHONY: all clean test testdata wasi-libc | ||
|
|
||
| testdata.c.src = $(wildcard testdata/c/*.c) | ||
| testdata.c.wasm = $(testdata.c.src:.c=.wasm) | ||
|
|
||
| testdata.go.src = $(wildcard testdata/go/*.go) | ||
| testdata.go.wasm = $(testdata.go.src:.go=.wasm) | ||
|
|
||
| testdata.tinygo.src = $(wildcard testdata/tinygo/*.go) | ||
| testdata.tinygo.wasm = $(testdata.tinygo.src:.go=.wasm) | ||
|
|
||
| testdata.wat.src = $(wildcard testdata/wat/*.go) | ||
| testdata.wat.wasm = $(testdata.wat.src:.wat=.wasm) | ||
|
|
||
| testdata.files = \ | ||
| $(testdata.c.wasm) \ | ||
| $(testdata.go.wasm) \ | ||
| $(testdata.tinygo.wasm) \ | ||
| $(testdata.wat.wasm) | ||
|
|
||
| all: test | ||
|
|
||
| clean: | ||
| rm -f $(testdata.files) | ||
|
|
||
| test: testdata | ||
| go test ./... | ||
|
|
||
| testdata: wasi-libc $(testdata.files) | ||
|
|
||
| testdata/.sysroot: | ||
| mkdir -p testdata/.sysroot | ||
|
|
||
| testdata/.wasi-libc: testdata/.wasi-libc/.git | ||
|
|
||
| testdata/.wasi-libc/.git: .gitmodules | ||
| git submodule update --init --recursive -- testdata/.wasi-libc | ||
|
|
||
| testdata/.sysroot/lib/wasm32-wasi/libc.a: testdata/.wasi-libc | ||
| make -j4 -C testdata/.wasi-libc install INSTALL_DIR=../.sysroot | ||
|
|
||
| testdata/c/%.c: wasi-libc | ||
| testdata/c/%.wasm: testdata/c/%.c | ||
| clang $< -o $@ -Wall -Os -target wasm32-unknown-wasi --sysroot testdata/.sysroot | ||
|
|
||
| testdata/go/%.wasm: testdata/go/%.go | ||
| GOARCH=wasm GOOS=wasip1 gotip build -o $@ $< | ||
|
|
||
| testdata/tinygo/%.wasm: testdata/tinygo/%.go | ||
| tinygo build -target=wasi -o $@ $< | ||
|
|
||
| testdata/wat/%.wasm: testdata/wat/%.wat | ||
| wat2wasm -o $@ $< | ||
|
|
||
| wasi-libc: testdata/.sysroot/lib/wasm32-wasi/libc.a | ||
|
|
||
| .gitmodules: | ||
| git submodule add --name wasi-libc -- \ | ||
| 'https://github.com/WebAssembly/wasi-libc' testdata/.wasi-libc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,6 @@ | ||
| github.com/google/pprof v0.0.0-20230406165453-00490a63f317 h1:hFhpt7CTmR3DX+b4R19ydQFtofxT0Sv3QsKNMVQYTMQ= | ||
| github.com/google/pprof v0.0.0-20230406165453-00490a63f317/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= | ||
| github.com/tetratelabs/wazero v1.1.0 h1:EByoAhC+QcYpwSZJSs/aV0uokxPwBgKxfiokSUwAknQ= | ||
| github.com/tetratelabs/wazero v1.1.0/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= | ||
| github.com/tetratelabs/wazero v1.1.1-0.20230511035210-78c35acd6e1c h1:3vKw5AyUv+16qm9tIVfvm205aDIpDmrjxPydJ87GBKY= | ||
| github.com/tetratelabs/wazero v1.1.1-0.20230511035210-78c35acd6e1c/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= | ||
| github.com/tetratelabs/wazero v1.1.1-0.20230512012700-13e38966b6e0 h1:HlJHKQkBSPsHxseQausjzcbvU+njYSkagrWdCS7x4kU= | ||
| github.com/tetratelabs/wazero v1.1.1-0.20230512012700-13e38966b6e0/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= | ||
| github.com/tetratelabs/wazero v1.1.1-0.20230522055633-256b7a4bf970 h1:X5OOeHRjoLA8XhVc7biEbh1/hnTzpYpPn7HuyarMslQ= | ||
| github.com/tetratelabs/wazero v1.1.1-0.20230522055633-256b7a4bf970/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= | ||
| golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o= | ||
| golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that submodule checked in on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the C/Rust builds are going to depend on it, so we can automate the full compilation.