mirror of
https://github.com/openssl/openssl.git
synced 2024-11-21 01:15:20 +08:00
ad887416f1
that needed test_main now works using the same infrastructure as tests that used register_tests. This meant: * renaming register_tests to setup_tests and giving it a success/failure return. * renaming the init_test function to setup_test_framework. * renaming the finish_test function to pulldown_test_framework. * adding a user provided global_init function that runs before the test frame work is initialised. It returns a failure indication that stops the stest. * adding helper functions that permit tests to access their command line args. * spliting the BIO initialisation and finalisation out from the test setup and teardown. * hiding some of the now test internal functions. * fix the comments in testutil.h Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3953)
52 lines
2.2 KiB
C
52 lines
2.2 KiB
C
/*
|
|
* Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
|
|
*
|
|
* Licensed under the OpenSSL license (the "License"). You may not use
|
|
* this file except in compliance with the License. You can obtain a copy
|
|
* in the file LICENSE in the source distribution or at
|
|
* https://www.openssl.org/source/license.html
|
|
*/
|
|
|
|
#include <stdlib.h> /* size_t */
|
|
#include <openssl/bn.h>
|
|
#include <openssl/bio.h>
|
|
#include "../testutil.h"
|
|
|
|
int subtest_level(void);
|
|
int openssl_error_cb(const char *str, size_t len, void *u);
|
|
const BIO_METHOD *BIO_f_tap(void);
|
|
|
|
void test_fail_message_prefix(const char *prefix, const char *file,
|
|
int line, const char *type,
|
|
const char *left, const char *right,
|
|
const char *op);
|
|
|
|
void test_fail_string_message(const char *prefix, const char *file,
|
|
int line, const char *type,
|
|
const char *left, const char *right,
|
|
const char *op, const char *m1, size_t l1,
|
|
const char *m2, size_t l2);
|
|
|
|
void test_fail_bignum_message(const char *prefix, const char *file,
|
|
int line, const char *type,
|
|
const char *left, const char *right,
|
|
const char *op,
|
|
const BIGNUM *bn1, const BIGNUM *bn2);
|
|
void test_fail_bignum_mono_message(const char *prefix, const char *file,
|
|
int line, const char *type,
|
|
const char *left, const char *right,
|
|
const char *op, const BIGNUM *bn);
|
|
|
|
void test_fail_memory_message(const char *prefix, const char *file,
|
|
int line, const char *type,
|
|
const char *left, const char *right,
|
|
const char *op,
|
|
const unsigned char *m1, size_t l1,
|
|
const unsigned char *m2, size_t l2);
|
|
|
|
void setup_test_framework(void);
|
|
__owur int pulldown_test_framework(int ret);
|
|
|
|
__owur int run_tests(const char *test_prog_name);
|
|
void set_test_title(const char *title);
|