Add main() test methods to reduce test boilerplate.
authorEmilia Kasper <emilia@openssl.org>
Mon, 7 Nov 2016 15:53:15 +0000 (16:53 +0100)
committerEmilia Kasper <emilia@openssl.org>
Wed, 9 Nov 2016 15:07:16 +0000 (16:07 +0100)
commite364c3b24e38bd60d40487e0a532261348a9bb10
tree82e621604899af53aebd34ced7d7dbc381678d84
parent7380737d77e89edd17651b04e439223a47ea833e
Add main() test methods to reduce test boilerplate.

Simple tests only need to implement register_tests().
Tests that need a custom main() should implement test_main(). This will
be wrapped in a main() that performs common setup/teardown (currently
crypto-mdebug).

Note that for normal development, enable-asan is usually
sufficient for detecting leaks, and more versatile.

enable-crypto-mdebug is stricter as it will also
insist that all static variables be freed. This is useful for debugging
library init/deinit; however, it also means that test_main() must free
everything it allocates.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
20 files changed:
test/asn1_internal_test.c
test/build.info
test/cipherlist_test.c
test/ct_test.c
test/d2i_test.c
test/dtlstest.c
test/mdc2_internal_test.c
test/modes_internal_test.c
test/poly1305_internal_test.c
test/ssl_test.c
test/ssl_test_ctx_test.c
test/sslapitest.c
test/test_main.c [new file with mode: 0644]
test/test_main.h [new file with mode: 0644]
test/test_main_custom.c [new file with mode: 0644]
test/test_main_custom.h [new file with mode: 0644]
test/testutil.c
test/testutil.h
test/wpackettest.c
test/x509_internal_test.c