Skip to content
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

tests: add standalone tests module for testing generated Go code #166

Merged
merged 24 commits into from
Oct 30, 2024

Conversation

ydnar
Copy link
Collaborator

@ydnar ydnar commented Sep 13, 2024

Implement a lightweight pattern for testing generated Go code using TinyGo + wasip2. In addition, the testdata directory now has an empty go.mod file to exclude it from module distribution.

  • Generated Go interfaces can be rebuild with make generate from the root directory.
  • To run tests, cd tests && tinygo test -v -target=./wasip2.json ./...

@ydnar ydnar self-assigned this Sep 13, 2024
@ydnar
Copy link
Collaborator Author

ydnar commented Sep 15, 2024

This requires TinyGo >= 0.33.1 to pass, which is not yet available.

.github/workflows/test.yaml Outdated Show resolved Hide resolved
tests/generated/wasi/clocks/monotonic-clock/empty.s Outdated Show resolved Hide resolved
tests/wasip2.json Outdated Show resolved Hide resolved
@ydnar ydnar force-pushed the ydnar/test-module branch 3 times, most recently from e289e39 to 0c9fe68 Compare September 24, 2024 05:40
@ydnar
Copy link
Collaborator Author

ydnar commented Oct 30, 2024

This now works with TinyGo 0.34.0!

@ydnar ydnar requested a review from Mossaka October 30, 2024 19:57
@ydnar ydnar merged commit 316d22c into main Oct 30, 2024
13 checks passed
@ydnar ydnar deleted the ydnar/test-module branch October 30, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants