Skip to content

Conversation

@xujuntwt95329
Copy link
Collaborator

No description provided.

@wenyongh wenyongh merged commit bc86674 into bytecodealliance:main Aug 12, 2022
loganek pushed a commit to loganek/wasm-micro-runtime that referenced this pull request Aug 31, 2022
…#1377)

Let iwasm return non-zero value when running failed
so that the caller (e.g. test framework) can check the
running status according to the return value.
@eloparco
Copy link
Contributor

eloparco commented Dec 23, 2022

Hello, I was looking into adding some tests (for WASI) and I see that spec tests are always enabled https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/tests/wamr-test-suites/test_wamr.sh#L177.

What's the reason behind always returning 0 when spec tests are enabled i.e. WASM_ENABLE_SPEC_TEST != 0, as introduced by this PR?

In my case I'd like to get a non-zero value when there's a failure so I'll have to turn WAMR_BUILD_SPEC_TEST off, but that will not allow me to run multiple test suites (i.e. ./test_wamr.sh -s wasi spec) at the same time, since they will require different values of WAMR_BUILD_SPEC_TEST.

@eloparco
Copy link
Contributor

Maybe it's not necessary anymore? I ran the GitHub actions after replacing

#if WASM_ENABLE_SPEC_TEST != 0
    (void)ret;
    return 0;
#else
    return ret;
#endif

with just return ret and the spec tests are passing. Am I missing anything?

@wenyongh
Copy link
Collaborator

Maybe it's not necessary anymore? I ran the GitHub actions after replacing

#if WASM_ENABLE_SPEC_TEST != 0
    (void)ret;
    return 0;
#else
    return ret;
#endif

with just return ret and the spec tests are passing. Am I missing anything?

Yes, seems that it's not necessary, it returned 0 before this PR, and in this PR we let it return 0 when spec test is enabled in case that the spec test script cannot handle the return value correctly when a non-zero is returned, e.g. loading a mal-formed wasm binary file. It seems that the spec test scripts work correctly and we can replace the code to return ret.

How about we fix it in the main branch, and then merge main branch into dev/wasi_threads?

vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…#1377)

Let iwasm return non-zero value when running failed
so that the caller (e.g. test framework) can check the
running status according to the return value.
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.

3 participants