also run test vs mtest with real random data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
diff --git a/.travis.yml b/.travis.yml
index fcc6dc2..37fe211 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,7 +19,9 @@ script:
- ./testme.sh --with-cc=$CC ${BUILDOPTIONS}
env:
- |
- BUILDOPTIONS="--test-vs-mtest=666666"
+ BUILDOPTIONS="--test-vs-mtest=333333"
+ - |
+ BUILDOPTIONS="--test-vs-mtest=333333 --mtest-real-rand"
- |
BUILDOPTIONS="--with-low-mp"
- |
diff --git a/mtest/mtest.c b/mtest/mtest.c
index af86920..1e2da10 100644
--- a/mtest/mtest.c
+++ b/mtest/mtest.c
@@ -151,8 +151,9 @@ int main(int argc, char *argv[])
if (rng == NULL) {
rng = fopen("/dev/random", "rb");
if (rng == NULL) {
- fprintf(stderr, "\nWarning: stdin used as random source\n\n");
- rng = stdin;
+ fprintf(stderr, "\nWarning: no /dev/[u]random available\n\n");
+ printf("exit\n");
+ return 1;
}
}
#else
diff --git a/testme.sh b/testme.sh
index acb8891..5dce2d2 100755
--- a/testme.sh
+++ b/testme.sh
@@ -48,6 +48,8 @@ _help()
echo
echo " --with-low-mp Also build&run tests with -DMP_{8,16,32}BIT."
echo
+ echo " --mtest-real-rand Use real random data when running mtest."
+ echo
echo "Godmode:"
echo
echo " --all Choose all architectures and gcc and clang as compilers"
@@ -115,6 +117,7 @@ COMPILERS=""
CFLAGS=""
WITH_LOW_MP=""
TEST_VS_MTEST=""
+MTEST_RAND=""
while [ $# -gt 0 ];
do
@@ -142,6 +145,9 @@ do
exit -1
fi
;;
+ --mtest-real-rand)
+ MTEST_RAND="-DLTM_MTEST_REAL_RAND"
+ ;;
--all)
COMPILERS="gcc clang"
ARCHFLAGS="-m64 -m32 -mx32"
@@ -184,7 +190,7 @@ then
make clean > /dev/null
_make "${compilers[0]} ${archflags[0]}" "$CFLAGS" "test"
echo
- _make "gcc" "" "mtest"
+ _make "gcc" "$MTEST_RAND" "mtest"
echo
echo "Run test vs. mtest for $TEST_VS_MTEST iterations"
for i in `seq 1 10` ; do sleep 500 && echo alive; done &