Skip to content

Commit

Permalink
Debug wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Aug 23, 2024
1 parent 56f671f commit 70c485a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ clean:

dist/c-lib.wasm: build/lib.c
@mkdir -p dist
@emcc build/lib.c -Wl,--whole-archive -DUNITY_END -O$(O) -o dist/c-lib.mjs
@emcc build/lib.c -Wl,--whole-archive -DUNITY_END -O$(O) -s EXPORTED_RUNTIME_METHODS="['UTF8ToString']" -o dist/c-lib.mjs

build/lib.c: ../LICENSE
@mkdir -p build
Expand Down
2 changes: 1 addition & 1 deletion cplusplus/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ clean:

dist/cp-lib.wasm: build/lib.cpp
@mkdir -p dist
@emcc build/lib.cpp -Wl,--whole-archive -DUNITY_END -O$(O) -o dist/cp-lib.mjs
@emcc build/lib.cpp -Wl,--whole-archive -DUNITY_END -O$(O) -s EXPORTED_RUNTIME_METHODS="['UTF8ToString']" -o dist/cp-lib.mjs

build/lib.cpp: ../LICENSE
@mkdir -p build
Expand Down
5 changes: 4 additions & 1 deletion docs/_static/test-c.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
describe(`run test ${p}`, function() {
this.timeout(Infinity);
it(`should return ${expected}`, () => {
const answer = func();
let answer = func();
if (typeof expected === 'string') {
answer = Module.UTF8ToString(answer);
}
console.log(p, answer, expected);
if (answer !== expected) {
throw new Error();
Expand Down
5 changes: 4 additions & 1 deletion docs/_static/test-cp.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
describe(`run test ${p}`, function() {
this.timeout(Infinity);
it(`should return ${expected}`, () => {
const answer = func();
let answer = func();
if (typeof expected === 'string') {
answer = Module.UTF8ToString(answer);
}
console.log(p, answer, expected);
if (answer !== expected) {
throw new Error();
Expand Down

0 comments on commit 70c485a

Please sign in to comment.