2 use File::Spec::Functions;
5 my ($base, $files) = @_;
6 return join(" ", map { "$base/$_" } split(/\s+/, $files));
10 IF[{- !$disabled{tests} -}]
11 LIBS_NO_INST=libtestutil.a
12 SOURCE[libtestutil.a]=testutil/basic_output.c testutil/driver.c \
13 testutil/tests.c testutil/test_main.c testutil/main.c \
14 {- rebase_files("../apps", $target{apps_aux_src}) -}
15 INCLUDE[libtestutil.a]=../include
16 DEPEND[libtestutil.a]=../libcrypto
20 sanitytest exdatatest bntest \
21 ectest ecdsatest gmdifftest pbelutest ideatest \
24 rc2test rc4test rc5test \
25 destest sha1test sha256t sha512t \
27 randtest dhtest enginetest casttest \
28 bftest ssltest_old dsatest exptest rsa_test \
29 evp_test evp_extra_test igetest v3nametest v3ext \
30 crltest danetest bad_dtls_test lhash_test \
31 constant_time_test verify_extra_test clienthellotest \
32 packettest asynctest secmemtest srptest memleaktest stack_test \
33 dtlsv1listentest ct_test threadstest afalgtest d2i_test \
34 ssl_test_ctx_test ssl_test x509aux cipherlist_test asynciotest \
35 bioprinttest sslapitest dtlstest sslcorrupttest bio_enc_test \
36 pkey_meth_test uitest cipherbytes_test asn1_encode_test \
37 x509_time_test x509_dup_cert_test recordlentest
39 SOURCE[aborttest]=aborttest.c
40 INCLUDE[aborttest]=../include
41 DEPEND[aborttest]=../libcrypto
43 SOURCE[sanitytest]=sanitytest.c testutil.c test_main.c
44 INCLUDE[sanitytest]=../include
45 DEPEND[sanitytest]=../libcrypto
47 SOURCE[test_test]=test_test.c testutil.c test_main.c
48 INCLUDE[test_test]=.. ../include
49 DEPEND[test_test]=../libcrypto
51 SOURCE[exdatatest]=exdatatest.c testutil.c test_main.c
52 INCLUDE[exdatatest]=../include
53 DEPEND[exdatatest]=../libcrypto
55 SOURCE[bntest]=bntest.c testutil.c test_main_custom.c
56 INCLUDE[bntest]=.. ../crypto/include ../include
57 DEPEND[bntest]=../libcrypto
59 SOURCE[ectest]=ectest.c
60 INCLUDE[ectest]=.. ../include
61 DEPEND[ectest]=../libcrypto
63 SOURCE[ecdsatest]=ecdsatest.c testutil.c test_main.c
64 INCLUDE[ecdsatest]=../include
65 DEPEND[ecdsatest]=../libcrypto
67 SOURCE[gmdifftest]=gmdifftest.c testutil.c test_main.c
68 INCLUDE[gmdifftest]=../include
69 DEPEND[gmdifftest]=../libcrypto
71 SOURCE[pbelutest]=pbelutest.c testutil.c test_main.c
72 INCLUDE[pbelutest]=../include
73 DEPEND[pbelutest]=../libcrypto
75 SOURCE[ideatest]=ideatest.c testutil.c test_main.c
76 INCLUDE[ideatest]=../include
77 DEPEND[ideatest]=../libcrypto
79 SOURCE[md2test]=md2test.c testutil.c test_main.c
80 INCLUDE[md2test]=../include
81 DEPEND[md2test]=../libcrypto
83 SOURCE[hmactest]=hmactest.c testutil.c test_main.c
84 INCLUDE[hmactest]=../include
85 DEPEND[hmactest]=../libcrypto
87 SOURCE[rc2test]=rc2test.c testutil.c test_main.c
88 INCLUDE[rc2test]=../include
89 DEPEND[rc2test]=../libcrypto
91 SOURCE[rc4test]=rc4test.c testutil.c test_main.c
92 INCLUDE[rc4test]=../include
93 DEPEND[rc4test]=../libcrypto
95 SOURCE[rc5test]=rc5test.c testutil.c test_main.c
96 INCLUDE[rc5test]=../include
97 DEPEND[rc5test]=../libcrypto
99 SOURCE[destest]=destest.c testutil.c test_main.c
100 INCLUDE[destest]=../include
101 DEPEND[destest]=../libcrypto
103 SOURCE[sha1test]=sha1test.c testutil.c test_main.c
104 INCLUDE[sha1test]=../include
105 DEPEND[sha1test]=../libcrypto
107 SOURCE[sha256t]=sha256t.c testutil.c test_main.c
108 INCLUDE[sha256t]=../include
109 DEPEND[sha256t]=../libcrypto
111 SOURCE[sha512t]=sha512t.c testutil.c test_main.c
112 INCLUDE[sha512t]=../include
113 DEPEND[sha512t]=../libcrypto
115 SOURCE[mdc2test]=mdc2test.c testutil.c test_main.c
116 INCLUDE[mdc2test]=../include
117 DEPEND[mdc2test]=../libcrypto
119 SOURCE[randtest]=randtest.c testutil.c test_main.c
120 INCLUDE[randtest]=../include
121 DEPEND[randtest]=../libcrypto
123 SOURCE[dhtest]=dhtest.c testutil.c test_main.c
124 INCLUDE[dhtest]=.. ../include
125 DEPEND[dhtest]=../libcrypto
127 SOURCE[enginetest]=enginetest.c testutil.c test_main.c
128 INCLUDE[enginetest]=../include
129 DEPEND[enginetest]=../libcrypto
131 SOURCE[casttest]=casttest.c testutil.c test_main.c
132 INCLUDE[casttest]=.. ../include
133 DEPEND[casttest]=../libcrypto
135 SOURCE[bftest]=bftest.c testutil.c test_main_custom.c
136 INCLUDE[bftest]=../include
137 DEPEND[bftest]=../libcrypto
139 SOURCE[ssltest_old]=ssltest_old.c
140 INCLUDE[ssltest_old]=.. ../include
141 DEPEND[ssltest_old]=../libcrypto ../libssl
143 SOURCE[dsatest]=dsatest.c testutil.c test_main.c
144 INCLUDE[dsatest]=.. ../include
145 DEPEND[dsatest]=../libcrypto
147 SOURCE[exptest]=exptest.c
148 INCLUDE[exptest]=../include
149 DEPEND[exptest]=../libcrypto
151 SOURCE[rsa_test]=rsa_test.c testutil.c test_main.c
152 INCLUDE[rsa_test]=.. ../include
153 DEPEND[rsa_test]=../libcrypto
155 SOURCE[evp_test]=evp_test.c
156 INCLUDE[evp_test]=../include
157 DEPEND[evp_test]=../libcrypto
159 SOURCE[evp_extra_test]=evp_extra_test.c testutil.c test_main.c
160 INCLUDE[evp_extra_test]=../include
161 DEPEND[evp_extra_test]=../libcrypto
163 SOURCE[igetest]=igetest.c
164 INCLUDE[igetest]=.. ../include
165 DEPEND[igetest]=../libcrypto
167 SOURCE[v3nametest]=v3nametest.c testutil.c test_main.c
168 INCLUDE[v3nametest]=.. ../include
169 DEPEND[v3nametest]=../libcrypto
171 SOURCE[crltest]=crltest.c testutil.c test_main.c
172 INCLUDE[crltest]=../include
173 DEPEND[crltest]=../libcrypto
175 SOURCE[v3ext]=v3ext.c testutil.c test_main_custom.c
176 INCLUDE[v3ext]=../include
177 DEPEND[v3ext]=../libcrypto
179 SOURCE[danetest]=danetest.c
180 INCLUDE[danetest]=../include
181 DEPEND[danetest]=../libcrypto ../libssl
183 SOURCE[constant_time_test]=constant_time_test.c testutil.c test_main.c
184 INCLUDE[constant_time_test]=.. ../include
185 DEPEND[constant_time_test]=../libcrypto
187 SOURCE[verify_extra_test]=verify_extra_test.c testutil.c test_main_custom.c
188 INCLUDE[verify_extra_test]=../include
189 DEPEND[verify_extra_test]=../libcrypto
191 SOURCE[clienthellotest]=clienthellotest.c testutil.c test_main_custom.c
192 INCLUDE[clienthellotest]=../include
193 DEPEND[clienthellotest]=../libcrypto ../libssl
195 SOURCE[bad_dtls_test]=bad_dtls_test.c testutil.c test_main.c
196 INCLUDE[bad_dtls_test]=../include
197 DEPEND[bad_dtls_test]=../libcrypto ../libssl
199 SOURCE[packettest]=packettest.c testutil.c test_main.c
200 INCLUDE[packettest]=../include
201 DEPEND[packettest]=../libcrypto
203 SOURCE[asynctest]=asynctest.c
204 INCLUDE[asynctest]=.. ../include
205 DEPEND[asynctest]=../libcrypto
207 SOURCE[secmemtest]=secmemtest.c testutil.c test_main.c
208 INCLUDE[secmemtest]=../include
209 DEPEND[secmemtest]=../libcrypto
211 SOURCE[srptest]=srptest.c testutil.c test_main.c
212 INCLUDE[srptest]=../include
213 DEPEND[srptest]=../libcrypto
215 SOURCE[memleaktest]=memleaktest.c testutil.c
216 INCLUDE[memleaktest]=../include
217 DEPEND[memleaktest]=../libcrypto
219 SOURCE[stack_test]=stack_test.c testutil.c test_main.c
220 INCLUDE[stack_test]=.. ../include
221 DEPEND[stack_test]=../libcrypto
223 SOURCE[lhash_test]=lhash_test.c testutil.c test_main.c
224 INCLUDE[lhash_test]=.. ../include
225 DEPEND[lhash_test]=../libcrypto
227 SOURCE[dtlsv1listentest]=dtlsv1listentest.c
228 INCLUDE[dtlsv1listentest]=.. ../include
229 DEPEND[dtlsv1listentest]=../libssl
231 SOURCE[ct_test]=ct_test.c testutil.c test_main_custom.c
232 INCLUDE[ct_test]=../crypto/include ../include
233 DEPEND[ct_test]=../libcrypto
235 SOURCE[threadstest]=threadstest.c testutil.c test_main.c
236 INCLUDE[threadstest]=.. ../include
237 DEPEND[threadstest]=../libcrypto
239 SOURCE[afalgtest]=afalgtest.c testutil.c
240 INCLUDE[afalgtest]=.. ../include
241 DEPEND[afalgtest]=../libcrypto
243 SOURCE[d2i_test]=d2i_test.c testutil.c test_main_custom.c
244 INCLUDE[d2i_test]=.. ../include
245 DEPEND[d2i_test]=../libcrypto
247 SOURCE[ssl_test_ctx_test]=ssl_test_ctx_test.c ssl_test_ctx.c testutil.c test_main_custom.c
248 INCLUDE[ssl_test_ctx_test]=.. ../include
249 DEPEND[ssl_test_ctx_test]=../libcrypto ../libssl
251 SOURCE[ssl_test]=ssl_test.c ssl_test_ctx.c testutil.c handshake_helper.c test_main_custom.c
252 INCLUDE[ssl_test]=.. ../include
253 DEPEND[ssl_test]=../libcrypto ../libssl
255 SOURCE[cipherlist_test]=cipherlist_test.c testutil.c test_main.c
256 INCLUDE[cipherlist_test]=.. ../include
257 DEPEND[cipherlist_test]=../libcrypto ../libssl
259 INCLUDE[testutil.o]=..
260 INCLUDE[ssl_test_ctx.o]=../include
261 INCLUDE[handshake_helper.o]=../include
262 INCLUDE[ssltestlib.o]=.. ../include
264 SOURCE[x509aux]=x509aux.c testutil.c test_main_custom.c
265 INCLUDE[x509aux]=.. ../include
266 DEPEND[x509aux]=../libcrypto
268 SOURCE[asynciotest]=asynciotest.c ssltestlib.c testutil.c test_main_custom.c
269 INCLUDE[asynciotest]=../include
270 DEPEND[asynciotest]=../libcrypto ../libssl
272 SOURCE[bioprinttest]=bioprinttest.c testutil.c test_main_custom.c
273 INCLUDE[bioprinttest]=../ ../include
274 DEPEND[bioprinttest]=../libcrypto
276 SOURCE[sslapitest]=sslapitest.c ssltestlib.c testutil.c test_main_custom.c
277 INCLUDE[sslapitest]=../include ..
278 DEPEND[sslapitest]=../libcrypto ../libssl
280 SOURCE[dtlstest]=dtlstest.c ssltestlib.c testutil.c test_main_custom.c
281 INCLUDE[dtlstest]=../include .
282 DEPEND[dtlstest]=../libcrypto ../libssl
284 SOURCE[sslcorrupttest]=sslcorrupttest.c ssltestlib.c testutil.c test_main_custom.c
285 INCLUDE[sslcorrupttest]=../include .
286 DEPEND[sslcorrupttest]=../libcrypto ../libssl
288 SOURCE[bio_enc_test]=bio_enc_test.c testutil.c test_main.c
289 INCLUDE[bio_enc_test]=../include
290 DEPEND[bio_enc_test]=../libcrypto
292 SOURCE[pkey_meth_test]=pkey_meth_test.c testutil.c test_main.c
293 INCLUDE[pkey_meth_test]=../include
294 DEPEND[pkey_meth_test]=../libcrypto
296 SOURCE[x509_time_test]=x509_time_test.c testutil.c test_main.c
297 INCLUDE[x509_time_test]=.. ../include
298 DEPEND[x509_time_test]=../libcrypto
300 SOURCE[recordlentest]=recordlentest.c ssltestlib.c testutil.c test_main_custom.c
301 INCLUDE[recordlentest]=../include .
302 DEPEND[recordlentest]=../libcrypto ../libssl
304 SOURCE[x509_dup_cert_test]=x509_dup_cert_test.c testutil.c test_main_custom.c
305 INCLUDE[x509_dup_cert_test]=../include
306 DEPEND[x509_dup_cert_test]=../libcrypto
308 IF[{- !$disabled{psk} -}]
309 PROGRAMS_NO_INST=dtls_mtu_test
310 SOURCE[dtls_mtu_test]=dtls_mtu_test.c ssltestlib.c
311 INCLUDE[dtls_mtu_test]=.. ../include
312 DEPEND[dtls_mtu_test]=../libcrypto ../libssl
315 IF[{- !$disabled{shared} -}]
316 PROGRAMS_NO_INST=shlibloadtest
317 SOURCE[shlibloadtest]=shlibloadtest.c
318 INCLUDE[shlibloadtest]=../include
321 IF[{- $disabled{shared} -}]
322 PROGRAMS_NO_INST=cipher_overhead_test
323 SOURCE[cipher_overhead_test]=cipher_overhead_test.c testutil.c test_main.c
324 INCLUDE[cipher_overhead_test]=.. ../include
325 DEPEND[cipher_overhead_test]=../libcrypto ../libssl
328 SOURCE[uitest]=uitest.c testutil.c test_main_custom.c \
329 ../apps/apps.c ../apps/opt.c {- $apps_extra -}
330 INCLUDE[uitest]=.. ../include
331 DEPEND[uitest]=../libcrypto ../libssl
333 SOURCE[cipherbytes_test]=cipherbytes_test.c testutil.c test_main_custom.c
334 INCLUDE[cipherbytes_test]=.. ../include
335 DEPEND[cipherbytes_test]=../libcrypto ../libssl
337 SOURCE[asn1_encode_test]=asn1_encode_test.c testutil.c test_main.c
338 INCLUDE[asn1_encode_test]=../include
339 DEPEND[asn1_encode_test]=../libcrypto
341 # Internal test programs. These are essentially a collection of internal
342 # test routines. Some of them need to reach internal symbols that aren't
343 # available through the shared library (at least on Linux, Solaris, Windows
344 # and VMS, where the exported symbols are those listed in util/*.num), these
345 # programs are forcibly linked with the static libraries, where all symbols
346 # are always available. This excludes linking these programs natively on
347 # Windows when building shared libraries, since the static libraries share
348 # names with the DLL import libraries.
349 IF[{- $disabled{shared} || $target{build_scheme}->[1] ne 'windows' -}]
350 PROGRAMS_NO_INST=asn1_internal_test modes_internal_test x509_internal_test \
351 tls13encryptiontest wpackettest
352 IF[{- !$disabled{poly1305} -}]
353 PROGRAMS_NO_INST=poly1305_internal_test
355 IF[{- !$disabled{chacha} -}]
356 PROGRAMS_NO_INST=chacha_internal_test
358 IF[{- !$disabled{siphash} -}]
359 PROGRAMS_NO_INST=siphash_internal_test
362 SOURCE[poly1305_internal_test]=poly1305_internal_test.c testutil.c test_main_custom.c
363 INCLUDE[poly1305_internal_test]=.. ../include ../crypto/include
364 DEPEND[poly1305_internal_test]=../libcrypto.a
366 SOURCE[chacha_internal_test]=chacha_internal_test.c testutil.c test_main.c
367 INCLUDE[chacha_internal_test]=.. ../include ../crypto/include
368 DEPEND[chacha_internal_test]=../libcrypto.a
370 SOURCE[asn1_internal_test]=asn1_internal_test.c testutil.c test_main.c
371 INCLUDE[asn1_internal_test]=.. ../include ../crypto/include
372 DEPEND[asn1_internal_test]=../libcrypto.a
374 SOURCE[modes_internal_test]=modes_internal_test.c testutil.c test_main_custom.c
375 INCLUDE[modes_internal_test]=.. ../include
376 DEPEND[modes_internal_test]=../libcrypto.a
378 SOURCE[x509_internal_test]=x509_internal_test.c testutil.c test_main.c
379 INCLUDE[x509_internal_test]=.. ../include
380 DEPEND[x509_internal_test]=../libcrypto.a
382 SOURCE[tls13encryptiontest]=tls13encryptiontest.c testutil.c test_main.c
383 INCLUDE[tls13encryptiontest]=.. ../include
384 DEPEND[tls13encryptiontest]=../libcrypto ../libssl.a
386 SOURCE[wpackettest]=wpackettest.c testutil.c test_main_custom.c
387 INCLUDE[wpackettest]=../include
388 DEPEND[wpackettest]=../libcrypto ../libssl.a
390 SOURCE[siphash_internal_test]=siphash_internal_test.c testutil.c test_main_custom.c
391 INCLUDE[siphash_internal_test]=.. ../include ../crypto/include
392 DEPEND[siphash_internal_test]=../libcrypto.a
395 IF[{- !$disabled{mdc2} -}]
396 PROGRAMS_NO_INST=mdc2_internal_test
399 SOURCE[mdc2_internal_test]=mdc2_internal_test.c testutil.c test_main.c
400 INCLUDE[mdc2_internal_test]=.. ../include
401 DEPEND[mdc2_internal_test]=../libcrypto
403 # We disable this test completely in a shared build because it deliberately
404 # redefines some internal libssl symbols. This doesn't work in a non-shared
406 IF[{- !$disabled{shared} -}]
407 PROGRAMS_NO_INST=tls13secretstest
408 SOURCE[tls13secretstest]=tls13secretstest.c testutil.c test_main.c
409 SOURCE[tls13secretstest]= ../ssl/tls13_enc.c ../ssl/packet.c
410 INCLUDE[tls13secretstest]=.. ../include
411 DEPEND[tls13secretstest]=../libcrypto ../libssl
416 use File::Spec::Functions;
418 use if $^O ne "VMS", 'File::Glob' => qw/glob/;
420 my @nogo_headers = ( "asn1_mac.h",
421 "__decc_include_prologue.h",
422 "__decc_include_epilogue.h" );
423 my @headerfiles = glob catfile($sourcedir,
424 updir(), "include", "openssl", "*.h");
426 foreach my $headerfile (@headerfiles) {
427 my $name = basename($headerfile, ".h");
428 next if $disabled{$name};
429 next if grep { $_ eq lc("$name.h") } @nogo_headers;
432 PROGRAMS_NO_INST=buildtest_$name
433 GENERATE[buildtest_$name.c]=generate_buildtest.pl $name
434 SOURCE[buildtest_$name]=buildtest_$name.c
435 INCLUDE[buildtest_$name]=../include
436 DEPEND[buildtest_$name]=../libssl ../libcrypto