Fix multi-command-exe test

This commit is contained in:
Felix Schütt
2022-12-29 17:56:32 +01:00
parent e00aae8f13
commit f3d0902f68
4 changed files with 18 additions and 9 deletions

View File

@@ -234,8 +234,15 @@ int main(int argc, char *argv[]) {
wasm_val_vec_t results = WASM_EMPTY_VEC;
own wasm_trap_t *trap = wasm_func_call(start_function, &args, &results);
if (trap) {
fprintf(stderr, "Trap is not NULL: TODO:\n");
return -1;
wasm_message_t retrieved_message;
// TODO: this is a shitty solution, but it's good enough for now
wasm_trap_message(trap, &retrieved_message);
if (strcmp(retrieved_message.data, "WASI exited with code: 0") == 0) {
wasm_trap_delete(trap);
} else {
fprintf(stderr, "%s", retrieved_message.data);
return -1;
}
}
#endif