Emscripten: run the tests in benchmark mode

This commit is contained in:
Frank Denis
2017-12-21 18:51:56 +01:00
parent 69834d667e
commit eeb135010d
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -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"
+4
View File
@@ -66,6 +66,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