add testme.sh
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
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"