Matt Caswell be9d82bb35 Teach ssl_test_old to use the FIPS provider for its tests пре 4 година
..
certs 3cb55fe47c Add test cases for the non CA certificate with pathlen:0 пре 4 година
ct 433deaffce Use .cnf for config files, not .conf пре 4 година
d2i-tests a378a46985 add test for CVE-2016-7053 пре 7 година
ocsp-tests 121738d1cb Fix OCSP_basic_verify() cert chain construction in case bs->certs is NULL пре 6 година
ossl_shim 3d48457478 Replace BUF_ string function calls with OPENSSL_ ones пре 4 година
recipes be9d82bb35 Teach ssl_test_old to use the FIPS provider for its tests пре 4 година
smime-certs 23f3993127 Remove RANDFILE settings from configuration files пре 4 година
ssl-tests 682bc861a9 Teach ssl_test_new how to test the FIPS module пре 4 година
testutil 8d242823ed Fix common test framework options пре 4 година
CAss.cnf 433deaffce Use .cnf for config files, not .conf пре 4 година
CAtsa.cnf 23f3993127 Remove RANDFILE settings from configuration files пре 4 година
P1ss.cnf 433deaffce Use .cnf for config files, not .conf пре 4 година
P2ss.cnf 433deaffce Use .cnf for config files, not .conf пре 4 година
README 51a7c4b5f2 TEST: Add test recipe and help program to test BIO_f_prefix() пре 4 година
README.external df4439186f Remove unnecessary trailing whitespace пре 5 година
README.ssltest.md 433deaffce Use .cnf for config files, not .conf пре 4 година
Uss.cnf 433deaffce Use .cnf for config files, not .conf пре 4 година
aborttest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
aesgcmtest.c dc64dc2edd Add EVP_CIPHER_CTX_tag_length() пре 4 година
afalgtest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
asn1_decode_test.c 936c2b9e93 Update source files for deprecation at 3.0 пре 4 година
asn1_dsa_internal_test.c 25f2138b0a Reorganize private crypto header files пре 4 година
asn1_encode_test.c 936c2b9e93 Update source files for deprecation at 3.0 пре 4 година
asn1_internal_test.c 25f2138b0a Reorganize private crypto header files пре 4 година
asn1_string_table_test.c 275a7b9e5e typo ANS1 -> ASN1 пре 5 година
asn1_time_test.c fe4309b0de Add duplication APIs to ASN1_TIME and related types пре 4 година
asynciotest.c 5e30f2fd58 Use a non-default libctx in sslapitest пре 4 година
asynctest.c 742ccab318 Deprecate most of debug-memory пре 4 година
bad_dtls_test.c a76ce2862b TLS: use EVP for HMAC throughout libssl. пре 4 година
bftest.c 03047e7b7f Deprecate Low Level Blowfish APIs пре 4 година
bio_callback_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
bio_enc_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
bio_memleak_test.c 742ccab318 Deprecate most of debug-memory пре 4 година
bio_prefix_text.c 51a7c4b5f2 TEST: Add test recipe and help program to test BIO_f_prefix() пре 4 година
bioprinttest.c 98f29466dc fix truncation of integers on 32bit AIX пре 5 година
bn_internal_test.c 25f2138b0a Reorganize private crypto header files пре 4 година
bn_rand_range.h 5d2f3e4a6c Test of uniformity of BN_rand_range output. пре 5 година
bntest.c 79c44b4e30 Fix some typos пре 4 година
bntests.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
build.info 4b1fe471ac HTTP client: make server/proxy and port params more consistent; minor other improvements пре 4 година
casttest.c 0ae5d4d6f8 Deprecate the Low Level CAST APIs пре 4 година
chacha_internal_test.c 25f2138b0a Reorganize private crypto header files пре 4 година
cipher_overhead_test.c 706457b7bd Reorganize local header files пре 4 година
cipherbytes_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
cipherlist_test.c 3c83c5ba4f Ignore cipher suites when setting cipher list пре 5 година
ciphername_test.c 98278b9631 TLS Cipher Suite 0xC102 Support пре 4 година
clienthellotest.c 8d242823ed Fix common test framework options пре 4 година
cmp_asn_test.c 3dbc5156b0 chunk 6 of CMP contribution to OpenSSL пре 4 година
cmp_client_test.c 7e765f46a6 Chunk 9 of CMP contribution to OpenSSL: CMP client and related tests пре 4 година
cmp_ctx_test.c 4b1fe471ac HTTP client: make server/proxy and port params more consistent; minor other improvements пре 4 година
cmp_hdr_test.c cfca56dfae Fix handling of CMP msg senderKID and improve doc of related CTX functions пре 4 година
cmp_msg_test.c 7e765f46a6 Chunk 9 of CMP contribution to OpenSSL: CMP client and related tests пре 4 година
cmp_protect_test.c 642f60d840 Rename CMP_PROTECTEDPART to OSSL_CMP_PROTECTEDPART for consistency пре 4 година
cmp_server_test.c 62dcd2aa17 Chunk 8 of CMP contribution to OpenSSL: CMP server and cmp_mock_srv.c for testing пре 4 година
cmp_status_test.c 62dcd2aa17 Chunk 8 of CMP contribution to OpenSSL: CMP server and cmp_mock_srv.c for testing пре 4 година
cmp_testlib.c 7e765f46a6 Chunk 9 of CMP contribution to OpenSSL: CMP client and related tests пре 4 година
cmp_testlib.h 7e765f46a6 Chunk 9 of CMP contribution to OpenSSL: CMP client and related tests пре 4 година
cmp_vfy_test.c 7e765f46a6 Chunk 9 of CMP contribution to OpenSSL: CMP client and related tests пре 4 година
cms-examples.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
cmsapitest.c 8d242823ed Fix common test framework options пре 4 година
conf_include_test.c 23f3993127 Remove RANDFILE settings from configuration files пре 4 година
confdump.c 9386303086 Make sure we free the CONF structure allocated by confdump пре 4 година
constant_time_test.c 706457b7bd Reorganize local header files пре 4 година
context_internal_test.c 1aedc35fd6 Instead of global data store it in an OPENSSL_CTX пре 5 година
crltest.c a727627922 Fix a memory leak with di2_X509_CRL reuse пре 5 година
ct_test.c 4d9e8c9554 Create a new embeddedSCTs1 that's signed using SHA256 пре 4 година
ctype_internal_test.c 25f2138b0a Reorganize private crypto header files пре 4 година
curve448_internal_test.c 4de88fe6da Implement a stricter ECX_KEY type пре 4 година
d2i_test.c 8d242823ed Fix common test framework options пре 4 година
danetest.c 8d242823ed Fix common test framework options пре 4 година
danetest.in 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
danetest.pem 170b735820 DANE support for X509_verify_cert() пре 8 година
default-and-fips.cnf 433deaffce Use .cnf for config files, not .conf пре 4 година
default-and-legacy.cnf e2f72313cc test/recipes/30-test_evp.t: Modify to test with different providers пре 4 година
default.cnf e2f72313cc test/recipes/30-test_evp.t: Modify to test with different providers пре 4 година
destest.c c6fec81b88 Deprecate the low level DES functions. пре 4 година
dhtest.c 55f02cb684 Change DH_get_nid() to set the value of q if it is not already set пре 4 година
drbg_cavs_data.h ae4186b004 Fix header file include guard names пре 4 година
drbg_cavs_data_ctr.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
drbg_cavs_data_hash.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
drbg_cavs_data_hmac.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
drbg_cavs_test.c 706457b7bd Reorganize local header files пре 4 година
drbg_extra_test.c 4d6d787c49 AES CTR-DRGB: add test for 32-bit counter overflow пре 4 година
drbg_extra_test.h 4d6d787c49 AES CTR-DRGB: add test for 32-bit counter overflow пре 4 година
drbgtest.c 09066cf2a1 tests/drbgtest: use new RAND_DRBG callback_data API instead of ex_data пре 4 година
drbgtest.h 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
dsa_no_digest_size_test.c f41ac0eeab Deprecate the low level DSA functions. пре 4 година
dsatest.c b03ec3b5d6 Add DSA keygen to provider пре 4 година
dtls_mtu_test.c 706457b7bd Reorganize local header files пре 4 година
dtlstest.c 5e30f2fd58 Use a non-default libctx in sslapitest пре 4 година
dtlsv1listentest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
ec_internal_test.c 579422c85c Deprecate the ECDSA and EV_KEY_METHOD functions. пре 4 година
ecdsatest.c fda127beb2 TEST: Adapt all applicable tests to the new distinguishing ID пре 4 година
ecdsatest.h ae4186b004 Fix header file include guard names пре 4 година
ecstresstest.c dd6b270618 Remove tab characters from C source files. пре 5 година
ectest.c 35ed029b5a Add self-test for EC_POINT_hex2point пре 4 година
enginetest.c 5800ba7610 test/enginetest.c: Make sure no config file is loaded пре 5 година
errtest.c b13342e933 Modernise the ERR functionality further (new functions and deprecations) пре 4 година
evp_extra_test.c 8a5cb59601 TEST: Add a test of keygen with an empty template in test/evp_extra_test.c пре 4 година
evp_fetch_prov_test.c 22e27978b2 Add support for passing the libctx to the config loader пре 4 година
evp_kdf_test.c 726ad13c4e Fix no-cmac and no-camellia пре 4 година
evp_pkey_dparams_test.c 10c25644e3 EC only uses approved curves in FIPS mode. пре 5 година
evp_pkey_provided_test.c 738ee1819e Fix DH_get_nid() so that it does not cache values. пре 4 година
evp_test.c 88af1ebb04 test/evp_test.c: fix keygen_test_run() пре 4 година
evp_test.h 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
exdatatest.c e17f5b6a6b Add CRYPTO_alloc_ex_data() пре 5 година
exptest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
fatalerrtest.c 5e30f2fd58 Use a non-default libctx in sslapitest пре 4 година
ffc_internal_test.c 738ee1819e Fix DH_get_nid() so that it does not cache values. пре 4 година
fips.cnf 433deaffce Use .cnf for config files, not .conf пре 4 година
fipsinstall.pl ae6b654b66 TEST: make and use a fipsinstall script пре 4 година
generate_buildtest.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
generate_ssl_tests.pl 682bc861a9 Teach ssl_test_new how to test the FIPS module пре 4 година
gmdifftest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
gosttest.c 5e30f2fd58 Use a non-default libctx in sslapitest пре 4 година
handshake_helper.c a76ce2862b TLS: use EVP for HMAC throughout libssl. пре 4 година
handshake_helper.h ae4186b004 Fix header file include guard names пре 4 година
hmactest.c dbde472688 Deprecate the low level HMAC functions пре 4 година
http_test.c afe554c2d2 Chunk 10 of CMP contribution to OpenSSL: CMP http client and related tests пре 4 година
ideatest.c da2d32f6db Deprecate the low level IDEA functions. пре 4 година
igetest.c 7573fe1af5 Deprecate the AES_ige_*() functions пре 4 година
keymgmt_internal_test.c 96ebe52e89 Add EVP_PKEY_gettable_params support for accessing EVP_PKEY key data fields пре 4 година
legacy.cnf e2f72313cc test/recipes/30-test_evp.t: Modify to test with different providers пре 4 година
lhash_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
mdc2_internal_test.c 33ee9ae059 Deprecate the low level MDC2 functions. пре 4 година
mdc2test.c 33ee9ae059 Deprecate the low level MDC2 functions. пре 4 година
memleaktest.c ea7a952c8a test/memleaktest.c: Modify for use with address/leak sanitizer пре 4 година
modes_internal_test.c c72fa2554f Deprecate the low level AES functions пре 4 година
namemap_internal_test.c e4a1d02300 Modify EVP_CIPHER_is_a() and EVP_MD_is_a() to handle legacy methods too пре 4 година
ocspapitest.c 8cc86b81ac Constify various mostly X509-related parameter types in crypto/ and apps/ пре 4 година
ossl_test_endian.h ae4186b004 Fix header file include guard names пре 4 година
p_test.c 551543e5e2 Add test for providers exposing OSSL_FUNC_PROVIDER_GET_REASON_STRINGS пре 4 година
packettest.c 0d345f0e10 Make the PACKET/WPACKET code available to both libcrypto and libssl пре 5 година
param_build_test.c 20c98cd453 Param builder: Remove the static size limit. пре 4 година
params_api_test.c 2c99372dbd test/params_api_test.c: Correct the checks of OSSL_PARAM_set_BN() пре 4 година
params_conversion_test.c 8d242823ed Fix common test framework options пре 4 година
params_test.c c2969ff6e7 Fix Typos пре 5 година
pbelutest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
pemtest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
pkcs7-1.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b пре 25 година
pkcs7.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b пре 25 година
pkey_meth_kdf_test.c 5a285addbf Added new EVP/KDF API. пре 5 година
pkey_meth_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
pkits-test.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
poly1305_internal_test.c 3d5a7578e0 Add ChaCha related ciphers to default provider пре 4 година
property_test.c bdbf2df2e6 Properties: make query cache reference count aware. пре 4 година
provider_internal_test.c 29dc6e00f2 Load the config file by default пре 4 година
provider_internal_test.cnf.in 433deaffce Use .cnf for config files, not .conf пре 4 година
provider_test.c 4e7991b497 Change OSSL_PARAM return size to not be a pointer. пре 5 година
rc2test.c ee2993abd0 Deprecate the low level RC2 functions пре 4 година
rc4test.c 85d843c8ec Deprecate the low level SHA functions. пре 4 година
rc5test.c 62c3fed0cd Deprecate the low level RC5 functions пре 4 година
rdrand_sanitytest.c 24fd8541d4 Remove extern declarations of OPENSSL_ia32cap_P пре 4 година
recordlentest.c 5e30f2fd58 Use a non-default libctx in sslapitest пре 4 година
rsa_complex.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
rsa_mp_test.c c5f8713443 Deprecate the low level RSA functions. пре 4 година
rsa_sp800_56b_test.c fd4a6e7d1e RSA generation: Use more bits of 1/sqrt(2) пре 4 година
rsa_test.c c5f8713443 Deprecate the low level RSA functions. пре 4 година
run_tests.pl e3d9a6b5f0 Rework test/run_tests.pl to support selective verbosity and TAP copy пре 4 година
sanitytest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
secmemtest.c 6943335e3e Make secure-memory be a config option пре 4 година
serverinfo.pem c655f40ed2 Require ServerInfo PEMs to be named "BEGIN SERVERINFO FOR"... пре 10 година
serverinfo2.pem b878afae4b Add a SERVERINFOV2 format test file пре 7 година
servername_test.c 5e30f2fd58 Use a non-default libctx in sslapitest пре 4 година
session.pem 6cf2dbd9fa Don't store the ticket nonce in the session пре 6 година
shibboleth.pfx 70bf33d182 Add PKCS#12 UTF-8 interoperability test. пре 7 година
shlibloadtest.c 50cd4768c6 Reorganize public header files (part 1) пре 4 година
siphash_internal_test.c 25f2138b0a Reorganize private crypto header files пре 4 година
sm2_internal_test.c 09736245b1 [test] Make sm2_internal_test less fragile to changes in the ec module пре 4 година
sm4_internal_test.c 25f2138b0a Reorganize private crypto header files пре 4 година
smcont.txt 382bb0b294 test/smcont.txt: trigger assertion in bio_enc.c. пре 8 година
sparse_array_test.c 25f2138b0a Reorganize private crypto header files пре 4 година
srptest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
ssl_cert_table_internal_test.c 706457b7bd Reorganize local header files пре 4 година
ssl_ctx_test.c 310553591c Add ssl_ctx_test to test suite. пре 4 година
ssl_test.c 682bc861a9 Teach ssl_test_new how to test the FIPS module пре 4 година
ssl_test.tmpl f4941736a9 test/ssl_test.tmpl: make it work with elderly perl. пре 7 година
ssl_test_ctx.c 09d62b336d Fix end-point shared secret for DTLS/SCTP пре 5 година
ssl_test_ctx.h ae4186b004 Fix header file include guard names пре 4 година
ssl_test_ctx_test.c 433deaffce Use .cnf for config files, not .conf пре 4 година
ssl_test_ctx_test.cnf 433deaffce Use .cnf for config files, not .conf пре 4 година
sslapitest.c 4f6c704495 Re-enable FIPS testing in sslapitest.c пре 4 година
sslbuffertest.c 5e30f2fd58 Use a non-default libctx in sslapitest пре 4 година
sslcorrupttest.c 5e30f2fd58 Use a non-default libctx in sslapitest пре 4 година
sslprovidertest.c 5e30f2fd58 Use a non-default libctx in sslapitest пре 4 година
ssltest_old.c be9d82bb35 Teach ssl_test_old to use the FIPS provider for its tests пре 4 година
ssltestlib.c 5e30f2fd58 Use a non-default libctx in sslapitest пре 4 година
ssltestlib.h 5e30f2fd58 Use a non-default libctx in sslapitest пре 4 година
stack_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
sysdefault.cnf 8a5ed9dce8 Apply system_default configuration on SSL_CTX_new(). пре 6 година
sysdefaulttest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
test.cnf d462b5ff21 Add -section option to 'req' command пре 4 година
test_test.c e0249827b3 Fix --strict-warnings build пре 4 година
testcrl.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b пре 25 година
testdsa.pem 79a578b902 Add private/public key conversion tests пре 9 година
testdsapub.pem 79a578b902 Add private/public key conversion tests пре 9 година
testec-p256.pem 79a578b902 Add private/public key conversion tests пре 9 година
testecpub-p256.pem 79a578b902 Add private/public key conversion tests пре 9 година
tested25519.pem 81722fdf2e More testing for CLI usage of Ed25519 and Ed448 keys пре 4 година
tested25519pub.pem 81722fdf2e More testing for CLI usage of Ed25519 and Ed448 keys пре 4 година
tested448.pem 81722fdf2e More testing for CLI usage of Ed25519 and Ed448 keys пре 4 година
tested448pub.pem 81722fdf2e More testing for CLI usage of Ed25519 and Ed448 keys пре 4 година
testp7.pem dcb1ef5c22 Change PKCS#7 test data to take account of removal of пре 24 година
testreq2.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b пре 25 година
testrsa.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b пре 25 година
testrsapub.pem 79a578b902 Add private/public key conversion tests пре 9 година
testsid.pem 45f55f6a5b Remove SSLv2 support пре 9 година
testutil.h 8d242823ed Fix common test framework options пре 4 година
testx509.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b пре 25 година
threadstest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
time_offset_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
tls13ccstest.c 5e30f2fd58 Use a non-default libctx in sslapitest пре 4 година
tls13encryptiontest.c 706457b7bd Reorganize local header files пре 4 година
tls13secretstest.c 9727f4e7fd Use a fetched cipher for the TLSv1.3 early secret пре 4 година
uitest.c a43ce58f55 Updated test command line parsing to support commmon commands пре 5 година
v3-cert1.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b пре 25 година
v3-cert2.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b пре 25 година
v3ext.c 8d242823ed Fix common test framework options пре 4 година
v3nametest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
verify_extra_test.c fda127beb2 TEST: Adapt all applicable tests to the new distinguishing ID пре 4 година
versions.c 909f1a2e51 Following the license change, modify the boilerplates in test/ пре 5 година
wpackettest.c a056ee28ed Add a WPACKET test for the new DER capability пре 4 година
x509_check_cert_pkey_test.c 8d242823ed Fix common test framework options пре 4 година
x509_dup_cert_test.c 8d242823ed Fix common test framework options пре 4 година
x509_internal_test.c 878dc8dd95 Join the x509 and x509v3 directories пре 5 година
x509_time_test.c 86723c2a10 coverity 1456639: fix NULL dereference пре 4 година
x509aux.c 8d242823ed Fix common test framework options пре 4 година

README

How to add recipes
==================

For any test that you want to perform, you write a script located in
test/recipes/, named {nn}-test_{name}.t, where {nn} is a two digit number and
{name} is a unique name of your choice.

Please note that if a test involves a new testing executable, you will need to
do some additions in test/build.info. Please refer to the section "Changes to
test/build.info" below.


Naming conventions
=================

A test executable is named test/{name}test.c

A test recipe is named test/recipes/{nn}-test_{name}.t, where {nn} is a two
digit number and {name} is a unique name of your choice.

The number {nn} is (somewhat loosely) grouped as follows:

00-04 sanity, internal and essential API tests
05-09 individual symmetric cipher algorithms
10-14 math (bignum)
15-19 individual asymmetric cipher algorithms
20-24 openssl commands (some otherwise not tested)
25-29 certificate forms, generation and verification
30-35 engine and evp
60-79 APIs:
60 X509 subsystem
61 BIO subsystem
65 CMP subsystem
70 PACKET layer
80-89 "larger" protocols (CA, CMS, OCSP, SSL, TSA)
90-98 misc
99 most time consuming tests [such as test_fuzz]


A recipe that just runs a test executable
=========================================

A script that just runs a program looks like this:

#! /usr/bin/perl

use OpenSSL::Test::Simple;

simple_test("test_{name}", "{name}test", "{name}");

{name} is the unique name you have chosen for your test.

The second argument to `simple_test' is the test executable, and `simple_test'
expects it to be located in test/

For documentation on OpenSSL::Test::Simple, do
`perldoc util/perl/OpenSSL/Test/Simple.pm'.


A recipe that runs a more complex test
======================================

For more complex tests, you will need to read up on Test::More and
OpenSSL::Test. Test::More is normally preinstalled, do `man Test::More' for
documentation. For OpenSSL::Test, do `perldoc util/perl/OpenSSL/Test.pm'.

A script to start from could be this:

#! /usr/bin/perl

use strict;
use warnings;
use OpenSSL::Test;

setup("test_{name}");

plan tests => 2; # The number of tests being performed

ok(test1, "test1");
ok(test2, "test1");

sub test1
{
# test feature 1
}

sub test2
{
# test feature 2
}


Changes to test/build.info
==========================

Whenever a new test involves a new test executable you need to do the
following (at all times, replace {NAME} and {name} with the name of your
test):

* add {name} to the list of programs under PROGRAMS_NO_INST

* create a three line description of how to build the test, you will have
to modify the include paths and source files if you don't want to use the
basic test framework:

SOURCE[{name}]={name}.c
INCLUDE[{name}]=.. ../include ../apps/include
DEPEND[{name}]=../libcrypto libtestutil.a

Generic form of C test executables
==================================

#include "testutil.h"

static int my_test(void)
{
int testresult = 0; /* Assume the test will fail */
int observed;

observed = function(); /* Call the code under test */
if (!TEST_int_eq(observed, 2)) /* Check the result is correct */
goto end; /* Exit on failure - optional */

testresult = 1; /* Mark the test case a success */
end:
cleanup(); /* Any cleanup you require */
return testresult;
}

int setup_tests(void)
{
ADD_TEST(my_test); /* Add each test separately */
return 1; /* Indicate success */
}

You should use the TEST_xxx macros provided by testutil.h to test all failure
conditions. These macros produce an error message in a standard format if the
condition is not met (and nothing if the condition is met). Additional
information can be presented with the TEST_info macro that takes a printf
format string and arguments. TEST_error is useful for complicated conditions,
it also takes a printf format string and argument. In all cases the TEST_xxx
macros are guaranteed to evaluate their arguments exactly once. This means
that expressions with side effects are allowed as parameters. Thus,

if (!TEST_ptr(ptr = OPENSSL_malloc(..)))

works fine and can be used in place of:

ptr = OPENSSL_malloc(..);
if (!TEST_ptr(ptr))

The former produces a more meaningful message on failure than the latter.