Commit 0fd5e6c17f6cd72db3f588d52891c180783278b5

Steffen Jaeckel 2014-12-11T14:59:35

add testme.sh

diff --git a/.gitignore b/.gitignore
index 373c3ad..6bf2b63 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,3 +41,6 @@ mtest.exe
 *.pdf
 *.out
 tommath.tex
+
+# ignore files generated by testme.sh
+test_*.txt
diff --git a/testme.sh b/testme.sh
new file mode 100755
index 0000000..8b65d2e
--- /dev/null
+++ b/testme.sh
@@ -0,0 +1,24 @@
+#!/bin/bash -e
+
+_runtest()
+{
+  echo "Run test $1 $2"
+  make clean > /dev/null
+  CC="$1" CFLAGS="$2" make test_standalone -j9 > /dev/null 2>test_gcc_errors.txt
+  ./test > test_$(echo ${1}${2}  | tr ' ' '_').txt
+}
+
+_runtest "gcc" ""
+_runtest "gcc" "-DMP_8BIT"
+_runtest "gcc" "-DMP_16BIT"
+_runtest "gcc" "-DMP_32BIT"
+_runtest "gcc -m32" ""
+_runtest "gcc -m32" "-DMP_8BIT"
+# mh, this configuration does not work! it gets stuck at
+# Testing (not safe-prime):        46 bits
+#_runtest "gcc -m32" "-DMP_16BIT"
+_runtest "gcc -m32" "-DMP_32BIT"
+_runtest "gcc -mx32" ""
+_runtest "gcc -mx32" "-DMP_8BIT"
+_runtest "gcc -mx32" "-DMP_16BIT"
+_runtest "gcc -mx32" "-DMP_32BIT"