also run test vs mtest with real random data

This commit is contained in:
Steffen Jaeckel 2017-10-19 12:01:58 +02:00
parent e156e7efcf
commit aaa52a3d71
3 changed files with 13 additions and 4 deletions

View File

@ -19,7 +19,9 @@ script:
- ./testme.sh --with-cc=$CC ${BUILDOPTIONS} - ./testme.sh --with-cc=$CC ${BUILDOPTIONS}
env: env:
- | - |
BUILDOPTIONS="--test-vs-mtest=666666" BUILDOPTIONS="--test-vs-mtest=333333"
- |
BUILDOPTIONS="--test-vs-mtest=333333 --mtest-real-rand"
- | - |
BUILDOPTIONS="--with-low-mp" BUILDOPTIONS="--with-low-mp"
- | - |

View File

@ -151,8 +151,9 @@ int main(int argc, char *argv[])
if (rng == NULL) { if (rng == NULL) {
rng = fopen("/dev/random", "rb"); rng = fopen("/dev/random", "rb");
if (rng == NULL) { if (rng == NULL) {
fprintf(stderr, "\nWarning: stdin used as random source\n\n"); fprintf(stderr, "\nWarning: no /dev/[u]random available\n\n");
rng = stdin; printf("exit\n");
return 1;
} }
} }
#else #else

View File

@ -48,6 +48,8 @@ _help()
echo echo
echo " --with-low-mp Also build&run tests with -DMP_{8,16,32}BIT." echo " --with-low-mp Also build&run tests with -DMP_{8,16,32}BIT."
echo echo
echo " --mtest-real-rand Use real random data when running mtest."
echo
echo "Godmode:" echo "Godmode:"
echo echo
echo " --all Choose all architectures and gcc and clang as compilers" echo " --all Choose all architectures and gcc and clang as compilers"
@ -115,6 +117,7 @@ COMPILERS=""
CFLAGS="" CFLAGS=""
WITH_LOW_MP="" WITH_LOW_MP=""
TEST_VS_MTEST="" TEST_VS_MTEST=""
MTEST_RAND=""
while [ $# -gt 0 ]; while [ $# -gt 0 ];
do do
@ -142,6 +145,9 @@ do
exit -1 exit -1
fi fi
;; ;;
--mtest-real-rand)
MTEST_RAND="-DLTM_MTEST_REAL_RAND"
;;
--all) --all)
COMPILERS="gcc clang" COMPILERS="gcc clang"
ARCHFLAGS="-m64 -m32 -mx32" ARCHFLAGS="-m64 -m32 -mx32"
@ -184,7 +190,7 @@ then
make clean > /dev/null make clean > /dev/null
_make "${compilers[0]} ${archflags[0]}" "$CFLAGS" "test" _make "${compilers[0]} ${archflags[0]}" "$CFLAGS" "test"
echo echo
_make "gcc" "" "mtest" _make "gcc" "$MTEST_RAND" "mtest"
echo echo
echo "Run test vs. mtest for $TEST_VS_MTEST iterations" echo "Run test vs. mtest for $TEST_VS_MTEST iterations"
for i in `seq 1 10` ; do sleep 500 && echo alive; done & for i in `seq 1 10` ; do sleep 500 && echo alive; done &