Make more use of emscripten_out/emscripten_err in test code. NFC - #19524
Merged
Merged
Conversation
sbc100
force-pushed
the
test_out_err
branch
2 times, most recently
from
August 3, 2023 14:43
7891f79 to
0150478
Compare
tlively
reviewed
Aug 3, 2023
Comment on lines
-2136
to
-2137
| if self.is_wasm(): | ||
| self.skipTest('wasm requires a proper asm module') |
Member
There was a problem hiding this comment.
Is this just a wildly outdated requirement?
Collaborator
Author
There was a problem hiding this comment.
Yes, I opened a seperate PR for this actually: #19967
| #include <emscripten.h> | ||
| EMSCRIPTEN_KEEPALIVE void foo() { | ||
| EM_ASM({ console.log("bar") }); | ||
| EM_ASM({ log("bar") }); |
Member
There was a problem hiding this comment.
Should this be out rather than log?
| int main() | ||
| { | ||
| EM_ASM(console.log(`Main thread stack base=0x${$0.toString(16)}, end=0x${$1.toString(16)}`), emscripten_stack_get_base(), emscripten_stack_get_end()); | ||
| EM_ASM(out(`Main thread stack base=0x${$0.toString(16)}, end=0x${$1.toString(16)}`), emscripten_stack_get_base(), emscripten_stack_get_end()); |
Member
There was a problem hiding this comment.
Do we want to standardize on using emscripten_outf rather than EM_ASM(out(...))?
Collaborator
Author
There was a problem hiding this comment.
In general I think yes. However, there are cases where EM_ASM is used instead to avoid pulling in the sprintf code form libc.. I'm not sure this is worth it for all most the most minimal tests.
I'll convert these ones here.
tlively
approved these changes
Aug 3, 2023
Using these emscripten wrappers has some advantages. In particular, with workers we have seen issues with writes to console.log/console.error being lost in some cases.
sbc100
enabled auto-merge (squash)
August 3, 2023 17:27
sbc100
added a commit
that referenced
this pull request
Aug 3, 2023
Some instances that I missed in #19524
sbc100
added a commit
that referenced
this pull request
Aug 3, 2023
sbc100
added a commit
that referenced
this pull request
Aug 3, 2023
sbc100
added a commit
that referenced
this pull request
Aug 4, 2023
Some instances that I missed in #19524
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Using these emscripten wrappers has some advantages. In particular, with workers we have seen issues with writes to
console.log/console.error being lost in some cases.