ut script; ut defines
[tweetnacl.d.git] / ut.sh
blob05b9db9b71fcb5c805976dbe0cca7c34db423a30
1 #!/bin/sh
4 USE_DMD="ona"
5 SHORT_TEST="ona"
7 while [ $# != 0 ]; do
8 if [ "z$1" = "z--help" ]; then
9 echo "usage: $0 [options]"
10 echo "options:"
11 echo " --dmd use DMD"
12 echo " --lite lite tests"
13 exit 1
15 if [ "z$1" = "z--dmd" ]; then
16 USE_DMD="tan"
17 elif [ "z$1" = "z--lite" ]; then
18 SHORT_TEST="tan"
19 else
20 echo "invalid arg: $1"
21 exit 1
23 shift
24 done
27 rm tweetNaCl tweetNaCl.o 2>/dev/null
29 if [ $USE_DMD = "tan" ]; then
30 if [ $SHORT_TEST = "tan" ]; then
31 tt=""
32 else
33 tt="-version=unittest_full"
35 echo -n "DMD..."
36 time dmd -version=tweetnacl_unittest -version=unittest_main $tt -unittest -O -inline -w -oftweetNaCl tweetNaCl.d
37 else
38 if [ $SHORT_TEST = "tan" ]; then
39 tt=""
40 else
41 tt="-fversion=unittest_full"
43 echo -n "GDC..."
44 time gdc -fversion=tweetnacl_unittest -fversion=unittest_main $tt -funittest -O3 -fwrapv -march=native -mtune=native -Wall -o tweetNaCl tweetNaCl.d
46 if [ $? != 0 ]; then
47 echo "FUCK!"
48 rm tweetNaCl.o 2>/dev/null
49 exit 1
51 rm tweetNaCl.o 2>/dev/null
53 time ./tweetNaCl