mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-24 12:36:01 -07:00
Emscripten: run the tests in benchmark mode
This commit is contained in:
parent
d7f8f6bc80
commit
bd631649c1
@ -42,6 +42,7 @@ elif [ "x$1" = "x--browser-tests" ]; then
|
|||||||
elif [ "x$1" = "x--tests" ]; then
|
elif [ "x$1" = "x--tests" ]; then
|
||||||
echo "Building for testing"
|
echo "Building for testing"
|
||||||
export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO"
|
export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO"
|
||||||
|
export CPPFLAGS="${CPPFLAGS} -DBENCHMARKS -DITERATIONS=10"
|
||||||
export LDFLAGS="${LDFLAGS} -s TOTAL_MEMORY=${TOTAL_MEMORY_TESTS}"
|
export LDFLAGS="${LDFLAGS} -s TOTAL_MEMORY=${TOTAL_MEMORY_TESTS}"
|
||||||
export PREFIX="$(pwd)/libsodium-js-tests"
|
export PREFIX="$(pwd)/libsodium-js-tests"
|
||||||
export DONE_FILE="$(pwd)/js-tests.done"
|
export DONE_FILE="$(pwd)/js-tests.done"
|
||||||
|
@ -137,6 +137,10 @@ int main(void)
|
|||||||
if (sodium_init() != 0) {
|
if (sodium_init() != 0) {
|
||||||
return 99;
|
return 99;
|
||||||
}
|
}
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
(void) fopen("/dev/null", "r");
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __EMSCRIPTEN__
|
#ifndef __EMSCRIPTEN__
|
||||||
randombytes_set_implementation(&randombytes_salsa20_implementation);
|
randombytes_set_implementation(&randombytes_salsa20_implementation);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user