diff --git a/c/Makefile b/c/Makefile index 7adef637..f2cff94f 100644 --- a/c/Makefile +++ b/c/Makefile @@ -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 diff --git a/cplusplus/Makefile b/cplusplus/Makefile index a842df99..7296e63c 100644 --- a/cplusplus/Makefile +++ b/cplusplus/Makefile @@ -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 diff --git a/docs/_static/test-c.html b/docs/_static/test-c.html index ad951e23..222e5f07 100644 --- a/docs/_static/test-c.html +++ b/docs/_static/test-c.html @@ -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(); diff --git a/docs/_static/test-cp.html b/docs/_static/test-cp.html index 400d8331..778e707d 100644 --- a/docs/_static/test-cp.html +++ b/docs/_static/test-cp.html @@ -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();