-
Notifications
You must be signed in to change notification settings - Fork 33
Build C test cases via Python script to target-specific dir #112
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
Conversation
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.
LGTM. Since I don't have 100% of the context on this, I think we should wait a few days for @loganek to be able to take a look as well
Hi, sorry I was on holidays. I'll follow-up on this, and other related topics in the next few days. |
tests/c/src/fopen-with-no-access.c
Outdated
@@ -7,7 +7,7 @@ int main() { | |||
FILE *file = fopen("fs-tests.dir/file", "r"); | |||
|
|||
assert(file == NULL); | |||
assert(errno == ENOTCAPABLE); | |||
assert(errno == ENOTCAPABLE || errno == ENOENT); |
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 it expected in wasip2 to return ENOENT when file is not accessible?
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, in wasip2 and beyond we got rid of the rights system from p1, so ENOTCAPABLE is no longer an applicable errno. It shouldn't be used at all in wasip2 and beyond.
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.
since those tests are also being used for p1 too, I'd suggest to either have a copy of that in the wasi version specific directory, or use a compiler's define for different WASI versions and conditionally turn this assert off or on. For this specific test my preference would be the latter given the test is almost compatible with all the WASI versions.
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.
This change is no longer part of this PR, fwiw, as it was merged in #110.
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.
should this be reverted and done correctly then given it's weakening the assertion for p1?
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.
I'm merging this PR as the change is not related, but please follow-up on this particular change.
As in WebAssembly#112, we reorganize the directory structure and change to a python build script, with the goal of making space for wasip3. Before, it was: - tests/rust/: Root of cargo package - tests/rust/src: Rust source files - tests/rust/testsuite: JSON test files, fs-tests.dir; built .wasm files dumped here Now it is: - tests/rust/wasm32-wasip1: Root of cargo package for wasip1 builds - tests/rust/wasm32-wasip1/src: Rust source, but also JSON and fs-tests.dir - tests/rust/testsuite/: Removed; instead it is a built dir - tests/rust/testsuite/wasm32-wasip1: All wasm and json files copied here
As in WebAssembly#112, we reorganize the directory structure and change to a python build script, with the goal of making space for wasip3. Before, it was: - tests/rust/: Root of cargo package - tests/rust/src: Rust source files - tests/rust/testsuite: JSON test files, fs-tests.dir; built .wasm files dumped here Now it is: - tests/rust/wasm32-wasip1: Root of cargo package for wasip1 builds - tests/rust/wasm32-wasip1/src: Rust source, but also JSON and fs-tests.dir - tests/rust/testsuite/: Removed; instead it is a built dir - tests/rust/testsuite/wasm32-wasip1: All wasm and json files copied here
As in WebAssembly#112, we reorganize the directory structure and change to a python build script, with the goal of making space for wasip3. Before, it was: - tests/rust/: Root of cargo package - tests/rust/src: Rust source files - tests/rust/testsuite: JSON test files, fs-tests.dir; built .wasm files dumped here Now it is: - tests/rust/wasm32-wasip1: Root of cargo package for wasip1 builds - tests/rust/wasm32-wasip1/src: Rust source, but also JSON and fs-tests.dir - tests/rust/testsuite/: Removed; instead it is a built dir - tests/rust/testsuite/wasm32-wasip1: All wasm and json files copied here
We move all the C sources from tests/c/testsuite to tests/c/src, somewhat like the Rust tests, then treat tests/c/testsuite as a built directory. The build script is rewritten to Python, as it is getting a bit more complicated. Tests are compiled into target-specific dirs, currently only tests/c/testsuite/wasm32-wasip1. The build script writes the version-specific manifest.json, so as to include the target in the test suite name. Workflows updated appropriately.
Rebased and simplified build.py. |
As in WebAssembly#112, we reorganize the directory structure and change to a python build script, with the goal of making space for wasip3. Before, it was: - tests/assemblyscript/: Root of npm repo - tests/assemblyscript/testsuite: AS source files, JSON test files; built .wasm files dumped here Now it is: - tests/assemblyscript/wasm32-wasip1: Root of npm package for wasip1 builds - tests/assemblyscript/wasm32-wasip1/src: Assemblyscript source, but also JSON - tests/assemblyscript/testsuite/: Removed; instead it is a built dir - tests/assemblyscript/testsuite/wasm32-wasip1: All wasm and json files copied here
As in WebAssembly#112, we reorganize the directory structure and change to a python build script, with the goal of harmonizing the various test suites, so that testsuite/ is always a built dir. Before, it was: - tests/assemblyscript/: Root of npm repo - tests/assemblyscript/testsuite: AS source files, JSON test files; built .wasm files dumped here Now it is: - tests/assemblyscript/wasm32-wasip1: Root of npm package for wasip1 builds - tests/assemblyscript/wasm32-wasip1/src: Assemblyscript source, but also JSON - tests/assemblyscript/testsuite/: Removed; instead it is a built dir - tests/assemblyscript/testsuite/wasm32-wasip1: All wasm and json files copied here
As in WebAssembly#112, we reorganize the directory structure and change to a python build script, with the goal of harmonizing the various test suites, so that testsuite/ is always a built dir. Before, it was: - tests/assemblyscript/: Root of npm repo - tests/assemblyscript/testsuite: AS source files, JSON test files; built .wasm files dumped here Now it is: - tests/assemblyscript/wasm32-wasip1: Root of npm package for wasip1 builds - tests/assemblyscript/wasm32-wasip1/src: Assemblyscript source, but also JSON - tests/assemblyscript/testsuite/: Removed; instead it is a built dir - tests/assemblyscript/testsuite/wasm32-wasip1: All wasm and json files copied here
As in WebAssembly#112, we reorganize the directory structure and change to a python build script, with the goal of making space for wasip3. Before, it was: - tests/rust/: Root of cargo package - tests/rust/src: Rust source files - tests/rust/testsuite: JSON test files, fs-tests.dir; built .wasm files dumped here Now it is: - tests/rust/wasm32-wasip1: Root of cargo package for wasip1 builds - tests/rust/wasm32-wasip1/src: Rust source, but also JSON and fs-tests.dir - tests/rust/testsuite/: Removed; instead it is a built dir - tests/rust/testsuite/wasm32-wasip1: All wasm and json files copied here
As in WebAssembly#112, we reorganize the directory structure and change to a python build script, with the goal of harmonizing the various test suites, so that testsuite/ is always a built dir. Before, it was: - tests/assemblyscript/: Root of npm repo - tests/assemblyscript/testsuite: AS source files, JSON test files; built .wasm files dumped here Now it is: - tests/assemblyscript/wasm32-wasip1: Root of npm package for wasip1 builds - tests/assemblyscript/wasm32-wasip1/src: Assemblyscript source, but also JSON - tests/assemblyscript/testsuite/: Removed; instead it is a built dir - tests/assemblyscript/testsuite/wasm32-wasip1: All wasm and json files copied here
@@ -0,0 +1,104 @@ | |||
#!/usr/bin/env python3 |
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.
just looking at the https://github.com/WebAssembly/wasi-testsuite/pull/114/files and it seems a lot of duplication, I wonder if we can refactor it in a way that the common part can be reused across different languages?
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.
I think yes, but wdyt about me doing that in a followup? It's a bit easier when the three implementations are actually there in the source tree.
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.
That's fine by me. Could you open a tracking issue so we don't forget about this? Thanks
.DS_Store | ||
/tests/c/testsuite/ |
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.
perhaps it's best to use relative path here?
As in WebAssembly#112, we reorganize the directory structure and change to a python build script, with the goal of making space for wasip3. Before, it was: - tests/rust/: Root of cargo package - tests/rust/src: Rust source files - tests/rust/testsuite: JSON test files, fs-tests.dir; built .wasm files dumped here Now it is: - tests/rust/wasm32-wasip1: Root of cargo package for wasip1 builds - tests/rust/wasm32-wasip1/src: Rust source, but also JSON and fs-tests.dir - tests/rust/testsuite/: Removed; instead it is a built dir - tests/rust/testsuite/wasm32-wasip1: All wasm and json files copied here
As in #112, we reorganize the directory structure and change to a python build script, with the goal of harmonizing the various test suites, so that testsuite/ is always a built dir. Before, it was: - tests/assemblyscript/: Root of npm repo - tests/assemblyscript/testsuite: AS source files, JSON test files; built .wasm files dumped here Now it is: - tests/assemblyscript/wasm32-wasip1: Root of npm package for wasip1 builds - tests/assemblyscript/wasm32-wasip1/src: Assemblyscript source, but also JSON - tests/assemblyscript/testsuite/: Removed; instead it is a built dir - tests/assemblyscript/testsuite/wasm32-wasip1: All wasm and json files copied here
As in WebAssembly#112, we reorganize the directory structure and change to a python build script, with the goal of making space for wasip3. Before, it was: - tests/rust/: Root of cargo package - tests/rust/src: Rust source files - tests/rust/testsuite: JSON test files, fs-tests.dir; built .wasm files dumped here Now it is: - tests/rust/wasm32-wasip1: Root of cargo package for wasip1 builds - tests/rust/wasm32-wasip1/src: Rust source, but also JSON and fs-tests.dir - tests/rust/testsuite/: Removed; instead it is a built dir - tests/rust/testsuite/wasm32-wasip1: All wasm and json files copied here
As in #112, we reorganize the directory structure and change to a python build script, with the goal of making space for wasip3. Before, it was: - tests/rust/: Root of cargo package - tests/rust/src: Rust source files - tests/rust/testsuite: JSON test files, fs-tests.dir; built .wasm files dumped here Now it is: - tests/rust/wasm32-wasip1: Root of cargo package for wasip1 builds - tests/rust/wasm32-wasip1/src: Rust source, but also JSON and fs-tests.dir - tests/rust/testsuite/: Removed; instead it is a built dir - tests/rust/testsuite/wasm32-wasip1: All wasm and json files copied here
We move all the C sources from tests/c/testsuite to tests/c/src, somewhat like the Rust tests, then treat tests/c/testsuite as a built directory.
The build script is rewritten to Python, as it is getting a bit more complicated.
Tests are compiled into target-specific dirs, currently only tests/c/testsuite/wasm32-wasip1.
The build script writes the version-specific manifest.json, so as to include the target in the test suite name.
Workflows updated appropriately.
Stacked on #110.