diff --git a/dist-build/emscripten.sh b/dist-build/emscripten.sh index af6e7c8c..35028e45 100755 --- a/dist-build/emscripten.sh +++ b/dist-build/emscripten.sh @@ -42,6 +42,7 @@ elif [ "x$1" = "x--browser-tests" ]; then elif [ "x$1" = "x--tests" ]; then echo "Building for testing" export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO" + export CPPFLAGS="${CPPFLAGS} -DBENCHMARKS -DITERATIONS=10" export LDFLAGS="${LDFLAGS} -s TOTAL_MEMORY=${TOTAL_MEMORY_TESTS}" export PREFIX="$(pwd)/libsodium-js-tests" export DONE_FILE="$(pwd)/js-tests.done" diff --git a/test/default/cmptest.h b/test/default/cmptest.h index bcf1064b..1a46d41b 100644 --- a/test/default/cmptest.h +++ b/test/default/cmptest.h @@ -137,6 +137,10 @@ int main(void) if (sodium_init() != 0) { return 99; } +#ifdef __EMSCRIPTEN__ + (void) fopen("/dev/null", "r"); +#endif + #ifndef __EMSCRIPTEN__ randombytes_set_implementation(&randombytes_salsa20_implementation); #endif