egra: don't use ENTER/LEAVE (because intel sux, and they are slower than the correspo...
[iv.d.git] / tweetNaCl_test / ut.sh
blob84c27fb7d0a3564ae37435c4a3ee569c4c77870b
1 #!/bin/sh
4 USE_DMD="tan"
5 USE_DMD_VANILLA="ona"
6 SHORT_TEST="ona"
7 USE_OPT="ona"
9 while [ $# != 0 ]; do
10 if [ "z$1" = "z--help" ]; then
11 echo "usage: $0 [options]"
12 echo "options:"
13 echo " --dmd use DMD"
14 echo " --lite lite tests"
15 echo " --dmdv use vanilla DMD"
16 echo " --gdc use GDC"
17 echo " --opt optimize"
18 exit 1
20 if [ "z$1" = "z--dmd" ]; then
21 USE_DMD="tan"
22 elif [ "z$1" = "z--lite" ]; then
23 SHORT_TEST="tan"
24 elif [ "z$1" = "z--dmdv" ]; then
25 USE_DMD="tan"
26 USE_DMD_VANILLA="tan"
27 elif [ "z$1" = "z--dmd" ]; then
28 USE_DMD="tan"
29 elif [ "z$1" = "z--gdc" ]; then
30 USE_DMD="ona"
31 elif [ "z$1" = "z--opt" ]; then
32 USE_OPT="tan"
33 elif [ "z$1" = "z--lite" ]; then
34 SHORT_TEST="tan"
35 elif [ "z$1" = "z--dmdv" ]; then
36 USE_DMD="tan"
37 USE_DMD_VANILLA="tan"
38 else
39 echo "invalid arg: $1"
40 exit 1
42 shift
43 done
46 rm tweetNaCl *.o 2>/dev/null
48 if [ $USE_DMD = "tan" ]; then
49 if [ $SHORT_TEST = "tan" ]; then
50 tt=""
51 else
52 tt="-version=unittest_full"
54 if [ $USE_DMD_VANILLA = "tan" ]; then
55 dmdbin="dmd67"
56 else
57 dmdbin="dmd"
59 echo -n "DMD... [$dmdbin]"
60 if [ $USE_OPT = "tan" ]; then
61 echo -n "[opt]"
62 opts="-O -inline"
63 else
64 opts=""
66 time "$dmdbin" $tt $opts -g -w -oftweetNaCl ../tweetNaCl.d tweetNaCl_test.d
67 else
68 if [ $SHORT_TEST = "tan" ]; then
69 tt=""
70 else
71 tt="-fversion=unittest_full"
73 echo -n "GDC..."
74 time gdc $tt -O3 -fwrapv -march=native -mtune=native -Wall -o tweetNaCl ../tweetNaCl.d tweetNaCl_test.d
76 if [ $? != 0 ]; then
77 echo "FUCK!"
78 rm *.o 2>/dev/null
79 exit 1
81 rm *.o 2>/dev/null
83 time ./tweetNaCl