-
Notifications
You must be signed in to change notification settings - Fork 21
/
test.sh
143 lines (130 loc) · 2.77 KB
/
test.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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/bash
platform=win32
noorig=0 # use original C code
noasm=0 # use asm code
noc=0 # use optimized C code
nodll=0 # use dll with asm optimizations (original code)
nong=0 # use zlib-ng
extraargs="--delete --compact --memory"
dllname=zlibwapi32.dll
dllname_ng=zlib-ng_32.dll
if [ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == "linux" ]; then
platform=unix
nodll=1
nong=1
fi
for arg in "$@"; do # using quoted $@ will allow to correctly separate arguments like [ --path="some string with spaces" -debug ]
# echo "ARG=$arg"
case $arg in
--noasm)
noasm=1
;;
--noc)
noc=1
;;
--noorig)
noorig=1
;;
--nodll)
nodll=1
;;
--nong)
nong=1
;;
--c)
noasm=1
nodll=1
noorig=1
nong=1
;;
--asm)
noc=1
nodll=1
noorig=1
nong=1
;;
--orig)
noc=1
nodll=1
noasm=1
nong=1
;;
--ng)
noc=1
noasm=1
nodll=1
noorig=1
nong=0
;;
--win64)
platform=win64
dllname=zlibwapi64.dll
dllname_ng=zlib-ng_64.dll
;;
--level=*|--exclude=*|--verify)
extraargs="$extraargs $arg"
;;
*)
if [ -d "$arg" ]; then
dir="$arg"
else
cat <<EOF
Usage: test.sh [path] [options]
Options:
--no[asm|c|orig|dll|ng] disable particular target
--c test only C implementation
--asm test only Asm implementation
--orig test only original implementation
--ng test only zlib-ng
--win64 test for 64-bit Windows