2 use File::Spec::Functions;
5 my ($base, $files) = @_;
6 return join(" ", map { "$base/$_" } split(/\s+/, $files));
9 IF[{- !$disabled{tests} -}]
13 ectest ecdsatest ecdhtest gmdifftest pbelutest ideatest \
14 md2test md4test md5test \
16 rc2test rc4test rc5test \
17 destest sha1test sha256t sha512t \
19 randtest dhtest enginetest casttest \
20 bftest ssltest_old dsatest exptest rsa_test \
21 evp_test evp_extra_test igetest v3nametest v3ext \
22 danetest heartbeat_test p5_crpt2_test bad_dtls_test \
23 constant_time_test verify_extra_test clienthellotest \
24 packettest asynctest secmemtest srptest memleaktest \
25 dtlsv1listentest ct_test threadstest afalgtest d2i_test \
26 ssl_test_ctx_test ssl_test x509aux cipherlist_test asynciotest \
27 bioprinttest sslapitest dtlstest bio_enc_test
29 SOURCE[aborttest]=aborttest.c
30 INCLUDE[aborttest]=../include
31 DEPEND[aborttest]=../libcrypto
33 SOURCE[sanitytest]=sanitytest.c
34 INCLUDE[sanitytest]=../include
35 DEPEND[sanitytest]=../libcrypto
37 SOURCE[bntest]=bntest.c
38 INCLUDE[bntest]=.. ../crypto/include ../include
39 DEPEND[bntest]=../libcrypto
41 SOURCE[ectest]=ectest.c
42 INCLUDE[ectest]=../include
43 DEPEND[ectest]=../libcrypto
45 SOURCE[ecdsatest]=ecdsatest.c
46 INCLUDE[ecdsatest]=../include
47 DEPEND[ecdsatest]=../libcrypto
49 SOURCE[ecdhtest]=ecdhtest.c
50 INCLUDE[ecdhtest]=../include
51 DEPEND[ecdhtest]=../libcrypto
53 SOURCE[gmdifftest]=gmdifftest.c
54 INCLUDE[gmdifftest]=../include
55 DEPEND[gmdifftest]=../libcrypto
57 SOURCE[pbelutest]=pbelutest.c
58 INCLUDE[pbelutest]=../include
59 DEPEND[pbelutest]=../libcrypto
61 SOURCE[ideatest]=ideatest.c
62 INCLUDE[ideatest]=../include
63 DEPEND[ideatest]=../libcrypto
65 SOURCE[md2test]=md2test.c
66 INCLUDE[md2test]=../include
67 DEPEND[md2test]=../libcrypto
69 SOURCE[md4test]=md4test.c
70 INCLUDE[md4test]=../include
71 DEPEND[md4test]=../libcrypto
73 SOURCE[md5test]=md5test.c
74 INCLUDE[md5test]=../include
75 DEPEND[md5test]=../libcrypto
77 SOURCE[hmactest]=hmactest.c
78 INCLUDE[hmactest]=../include
79 DEPEND[hmactest]=../libcrypto
81 SOURCE[wp_test]=wp_test.c
82 INCLUDE[wp_test]=../include
83 DEPEND[wp_test]=../libcrypto
85 SOURCE[rc2test]=rc2test.c
86 INCLUDE[rc2test]=../include
87 DEPEND[rc2test]=../libcrypto
89 SOURCE[rc4test]=rc4test.c
90 INCLUDE[rc4test]=../include
91 DEPEND[rc4test]=../libcrypto
93 SOURCE[rc5test]=rc5test.c
94 INCLUDE[rc5test]=../include
95 DEPEND[rc5test]=../libcrypto
97 SOURCE[destest]=destest.c
98 INCLUDE[destest]=../include
99 DEPEND[destest]=../libcrypto
101 SOURCE[sha1test]=sha1test.c
102 INCLUDE[sha1test]=../include
103 DEPEND[sha1test]=../libcrypto
105 SOURCE[sha256t]=sha256t.c
106 INCLUDE[sha256t]=../include
107 DEPEND[sha256t]=../libcrypto
109 SOURCE[sha512t]=sha512t.c
110 INCLUDE[sha512t]=../include
111 DEPEND[sha512t]=../libcrypto
113 SOURCE[mdc2test]=mdc2test.c
114 INCLUDE[mdc2test]=../include
115 DEPEND[mdc2test]=../libcrypto
117 SOURCE[rmdtest]=rmdtest.c
118 INCLUDE[rmdtest]=../include
119 DEPEND[rmdtest]=../libcrypto
121 SOURCE[randtest]=randtest.c
122 INCLUDE[randtest]=../include
123 DEPEND[randtest]=../libcrypto
125 SOURCE[dhtest]=dhtest.c
126 INCLUDE[dhtest]=../include
127 DEPEND[dhtest]=../libcrypto
129 SOURCE[enginetest]=enginetest.c
130 INCLUDE[enginetest]=../include
131 DEPEND[enginetest]=../libcrypto
133 SOURCE[casttest]=casttest.c
134 INCLUDE[casttest]=../include
135 DEPEND[casttest]=../libcrypto
137 SOURCE[bftest]=bftest.c
138 INCLUDE[bftest]=../include
139 DEPEND[bftest]=../libcrypto
141 SOURCE[ssltest_old]=ssltest_old.c
142 INCLUDE[ssltest_old]=.. ../include
143 DEPEND[ssltest_old]=../libcrypto ../libssl
145 SOURCE[dsatest]=dsatest.c
146 INCLUDE[dsatest]=../include
147 DEPEND[dsatest]=../libcrypto
149 SOURCE[exptest]=exptest.c
150 INCLUDE[exptest]=../include
151 DEPEND[exptest]=../libcrypto
153 SOURCE[rsa_test]=rsa_test.c
154 INCLUDE[rsa_test]=.. ../include
155 DEPEND[rsa_test]=../libcrypto
157 SOURCE[evp_test]=evp_test.c
158 INCLUDE[evp_test]=../include
159 DEPEND[evp_test]=../libcrypto
161 SOURCE[evp_extra_test]=evp_extra_test.c
162 INCLUDE[evp_extra_test]=../include
163 DEPEND[evp_extra_test]=../libcrypto
165 SOURCE[igetest]=igetest.c
166 INCLUDE[igetest]=.. ../include
167 DEPEND[igetest]=../libcrypto
169 SOURCE[v3nametest]=v3nametest.c
170 INCLUDE[v3nametest]=../include
171 DEPEND[v3nametest]=../libcrypto
173 SOURCE[v3ext]=v3ext.c
174 INCLUDE[v3ext]=../include
175 DEPEND[v3ext]=../libcrypto
177 SOURCE[danetest]=danetest.c
178 INCLUDE[danetest]=../include
179 DEPEND[danetest]=../libcrypto ../libssl
181 SOURCE[heartbeat_test]=heartbeat_test.c testutil.c
182 INCLUDE[heartbeat_test]=.. ../include
183 DEPEND[heartbeat_test]=../libcrypto ../libssl
185 SOURCE[p5_crpt2_test]=p5_crpt2_test.c
186 INCLUDE[p5_crpt2_test]=../include
187 DEPEND[p5_crpt2_test]=../libcrypto
189 SOURCE[constant_time_test]=constant_time_test.c
190 INCLUDE[constant_time_test]=.. ../include
191 DEPEND[constant_time_test]=../libcrypto
193 SOURCE[verify_extra_test]=verify_extra_test.c
194 INCLUDE[verify_extra_test]=../include
195 DEPEND[verify_extra_test]=../libcrypto
197 SOURCE[clienthellotest]=clienthellotest.c
198 INCLUDE[clienthellotest]=../include
199 DEPEND[clienthellotest]=../libcrypto ../libssl
201 SOURCE[bad_dtls_test]=bad_dtls_test.c
202 INCLUDE[bad_dtls_test]=../include
203 DEPEND[bad_dtls_test]=../libcrypto ../libssl
205 SOURCE[packettest]=packettest.c
206 INCLUDE[packettest]=../include
207 DEPEND[packettest]=../libcrypto
209 SOURCE[asynctest]=asynctest.c
210 INCLUDE[asynctest]=.. ../include
211 DEPEND[asynctest]=../libcrypto
213 SOURCE[secmemtest]=secmemtest.c
214 INCLUDE[secmemtest]=../include
215 DEPEND[secmemtest]=../libcrypto
217 SOURCE[srptest]=srptest.c
218 INCLUDE[srptest]=../include
219 DEPEND[srptest]=../libcrypto
221 SOURCE[memleaktest]=memleaktest.c
222 INCLUDE[memleaktest]=../include
223 DEPEND[memleaktest]=../libcrypto
225 SOURCE[dtlsv1listentest]=dtlsv1listentest.c
226 INCLUDE[dtlsv1listentest]=.. ../include
227 DEPEND[dtlsv1listentest]=../libssl
229 SOURCE[ct_test]=ct_test.c testutil.c
230 INCLUDE[ct_test]=../crypto/include ../include
231 DEPEND[ct_test]=../libcrypto
233 SOURCE[threadstest]=threadstest.c
234 INCLUDE[threadstest]=.. ../include
235 DEPEND[threadstest]=../libcrypto
237 SOURCE[afalgtest]=afalgtest.c
238 INCLUDE[afalgtest]=.. ../include
239 DEPEND[afalgtest]=../libcrypto
241 SOURCE[d2i_test]=d2i_test.c testutil.c
242 INCLUDE[d2i_test]=.. ../include
243 DEPEND[d2i_test]=../libcrypto
245 SOURCE[ssl_test_ctx_test]=ssl_test_ctx_test.c ssl_test_ctx.c testutil.c
246 INCLUDE[ssl_test_ctx_test]=.. ../include
247 DEPEND[ssl_test_ctx_test]=../libcrypto
249 SOURCE[ssl_test]=ssl_test.c ssl_test_ctx.c testutil.c handshake_helper.c
250 INCLUDE[ssl_test]=.. ../include
251 DEPEND[ssl_test]=../libcrypto ../libssl
253 SOURCE[cipherlist_test]=cipherlist_test.c testutil.c
254 INCLUDE[cipherlist_test]=.. ../include
255 DEPEND[cipherlist_test]=../libcrypto ../libssl
257 INCLUDE[testutil.o]=..
258 INCLUDE[ssl_test_ctx.o]=../include
259 INCLUDE[handshake_helper.o]=../include
260 INCLUDE[ssltestlib.o]=../include
262 SOURCE[x509aux]=x509aux.c
263 INCLUDE[x509aux]=../include
264 DEPEND[x509aux]=../libcrypto
266 SOURCE[asynciotest]=asynciotest.c ssltestlib.c
267 INCLUDE[asynciotest]=../include
268 DEPEND[asynciotest]=../libcrypto ../libssl
270 SOURCE[bioprinttest]=bioprinttest.c
271 INCLUDE[bioprinttest]=../include
272 DEPEND[bioprinttest]=../libcrypto
274 SOURCE[sslapitest]=sslapitest.c ssltestlib.c testutil.c
275 INCLUDE[sslapitest]=../include
276 DEPEND[sslapitest]=../libcrypto ../libssl
278 SOURCE[dtlstest]=dtlstest.c ssltestlib.c testutil.c
279 INCLUDE[dtlstest]=../include .
280 DEPEND[dtlstest]=../libcrypto ../libssl
282 SOURCE[bio_enc_test]=bio_enc_test.c
283 INCLUDE[bio_enc_test]=../include
284 DEPEND[bio_enc_test]=../libcrypto
286 IF[{- !$disabled{psk} -}]
287 PROGRAMS_NO_INST=dtls_mtu_test
288 SOURCE[dtls_mtu_test]=dtls_mtu_test.c ssltestlib.c
289 INCLUDE[dtls_mtu_test]=.. ../include
290 DEPEND[dtls_mtu_test]=../libcrypto ../libssl
293 IF[{- !$disabled{shared} -}]
294 PROGRAMS_NO_INST=shlibloadtest
295 SOURCE[shlibloadtest]=shlibloadtest.c
296 INCLUDE[shlibloadtest]=../include
299 IF[{- $disabled{shared} -}]
300 PROGRAMS_NO_INST=wpackettest cipher_overhead_test
301 SOURCE[wpackettest]=wpackettest.c testutil.c
302 INCLUDE[wpackettest]=../include
303 DEPEND[wpackettest]=../libcrypto ../libssl
305 SOURCE[cipher_overhead_test]=cipher_overhead_test.c
306 INCLUDE[cipher_overhead_test]=.. ../include
307 DEPEND[cipher_overhead_test]=../libcrypto ../libssl
310 # Internal test programs. These are essentially a collection of internal
311 # test routines. Because they sometimes need to reach internal symbols that
312 # aren't available through the shared library (at least on Linux, Solaris,
313 # Windows and VMS, where the exported symbols are those listed in util/*.num),
314 # these programs may be built on files directly picked from inside crypto/
315 # or ssl/, to test using symbols that exist in those specific files. These
316 # programs will also be linked with libcrypto / libssl, so we don't pick
317 # out more specific files than necessary.
318 # This might mean we have multiply defined symbols, but since linking is
319 # ordered with object files first and libraries after, the symbols from the
320 # object files will be chosen before those in the libraries. This is handled
321 # properly by all linkers.
322 # Note that when building with static libraries, none of those extra files
323 # are needed, since all symbols are available anyway, regardless of what's
324 # listed in util/*.num.
325 PROGRAMS_NO_INST=asn1_internal_test modes_internal_test x509_internal_test
326 IF[{- !$disabled{mdc2} -}]
327 PROGRAMS_NO_INST=mdc2_internal_test
329 IF[{- !$disabled{poly1305} -}]
330 PROGRAMS_NO_INST=poly1305_internal_test
333 SOURCE[poly1305_internal_test]=poly1305_internal_test.c testutil.c
334 IF[{- !$disabled{shared} -}]
335 SOURCE[poly1305_internal_test]= ../crypto/poly1305/poly1305.c \
336 {- rebase_files("../crypto/poly1305", $target{poly1305_asm_src}) -} \
337 {- rebase_files("../crypto", $target{cpuid_asm_src}) -} \
340 INCLUDE[poly1305_internal_test]=.. ../include ../crypto/include
341 DEPEND[poly1305_internal_test]=../libcrypto
343 SOURCE[asn1_internal_test]=asn1_internal_test.c testutil.c
344 IF[{- !$disabled{shared} -}]
345 SOURCE[asn1_internal_test]= ../crypto/asn1/a_strnid.c \
346 ../crypto/rsa/rsa_ameth.c ../crypto/dsa/dsa_ameth.c \
347 ../crypto/dh/dh_ameth.c ../crypto/ec/ec_ameth.c \
348 ../crypto/hmac/hm_ameth.c ../crypto/cmac/cm_ameth.c \
349 ../crypto/ec/ecx_meth.c ../crypto/ec/curve25519.c
351 INCLUDE[asn1_internal_test]=.. ../include ../crypto/include
352 DEPEND[asn1_internal_test]=../libcrypto
354 SOURCE[modes_internal_test]=modes_internal_test.c testutil.c
355 IF[{- !$disabled{shared} -}]
356 SOURCE[modes_internal_test]= \
357 {- rebase_files("../crypto", $target{cpuid_asm_src}); -} \
360 INCLUDE[modes_internal_test]=.. ../include
361 DEPEND[modes_internal_test]=../libcrypto
363 # The reason for the huge amount of directly included x509v3 files
364 # is that a table that is checked by x509_internal_test refers to
365 # structures that are spread all over those files.
366 SOURCE[x509_internal_test]=x509_internal_test.c testutil.c
367 IF[{- !$disabled{shared} -}]
368 SOURCE[x509_internal_test]= ../crypto/x509v3/v3_bitst.c \
369 ../crypto/x509v3/v3_ia5.c ../crypto/x509v3/v3_skey.c \
370 ../crypto/x509v3/v3_pku.c ../crypto/x509v3/v3_alt.c \
371 ../crypto/x509v3/v3_bcons.c ../crypto/x509v3/v3_int.c \
372 ../crypto/x509v3/v3_cpols.c ../crypto/x509v3/v3_akey.c \
373 ../crypto/x509v3/v3_crld.c ../crypto/x509v3/v3_utl.c \
374 ../crypto/x509v3/v3_extku.c ../crypto/x509v3/v3_enum.c \
375 ../crypto/x509v3/v3_sxnet.c ../crypto/x509v3/v3_info.c \
376 ../crypto/x509v3/v3_addr.c ../crypto/x509v3/v3_asid.c \
377 ../crypto/x509v3/v3_pcons.c ../crypto/x509v3/v3_pmaps.c \
378 ../crypto/x509v3/v3_pci.c ../crypto/x509v3/v3_ncons.c \
379 ../crypto/x509v3/v3_tlsf.c ../crypto/ocsp/v3_ocsp.c \
380 ../crypto/ct/ct_x509v3.c ../crypto/asn1/a_strex.c
382 INCLUDE[x509_internal_test]=.. ../include
383 DEPEND[x509_internal_test]=../libcrypto
385 SOURCE[mdc2_internal_test]=mdc2_internal_test.c testutil.c
386 INCLUDE[mdc2_internal_test]=.. ../include
387 DEPEND[mdc2_internal_test]=../libcrypto
391 use File::Spec::Functions;
393 use if $^O ne "VMS", 'File::Glob' => qw/glob/;
395 my @nogo_headers = ( "asn1_mac.h",
396 "__decc_include_prologue.h",
397 "__decc_include_epilogue.h" );
398 my @headerfiles = glob catfile($sourcedir,
399 updir(), "include", "openssl", "*.h");
401 foreach my $headerfile (@headerfiles) {
402 my $name = basename($headerfile, ".h");
403 next if $disabled{$name};
404 next if grep { $_ eq lc("$name.h") } @nogo_headers;
407 PROGRAMS_NO_INST=buildtest_$name
408 GENERATE[buildtest_$name.c]=generate_buildtest.pl $name
409 SOURCE[buildtest_$name]=buildtest_$name.c
410 INCLUDE[buildtest_$name]=../include
411 DEPEND[buildtest_$name]=../libssl ../libcrypto