Correct the checks of module availability in provider test programs

Previously, the macro OPENSSL_NO_SHARED was defined of the test/p_test
module wasn't built, but the provider test programs didn't check that
macro.  We rename it to OPENSSL_NO_MODULE, since that name describes
the situation more than OPENSSL_NO_SHARED does, and use it.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/8623)
This commit is contained in:
Richard Levitte 2019-03-31 15:26:26 +02:00
parent 34786bdee0
commit 521b7cb388
3 changed files with 8 additions and 18 deletions

View file

@ -611,9 +611,10 @@ IF[{- !$disabled{tests} -}]
SOURCE[p_test]=p_test.ld
GENERATE[p_test.ld]=../util/providers.num
ENDIF
ELSE
DEFINE[provider_test]=OPENSSL_NO_SHARED
DEFINE[provider_internal_test]=OPENSSL_NO_SHARED
ENDIF
IF[{- $disabled{module} || !$target{dso_scheme} -}]
DEFINE[provider_test]=OPENSSL_NO_MODULE
DEFINE[provider_internal_test]=OPENSSL_NO_MODULE
ENDIF
PROGRAMS{noinst}=params_test

View file

@ -11,11 +11,6 @@
#include "internal/provider.h"
#include "testutil.h"
#if !defined(DSO_VMS) && !defined(DSO_DLCFN) && !defined(DSO_DL) \
&& !defined(DSO_WIN32) && !defined(DSO_DLFCN)
# define OPENSSL_NO_DSO
#endif
extern OSSL_provider_init_fn PROVIDER_INIT_FUNCTION_NAME;
static char buf[256];
@ -61,7 +56,7 @@ static int test_builtin_provider(void)
&& test_provider(prov);
}
#ifndef OPENSSL_NO_DSO
#ifndef OPENSSL_NO_MODULE
static int test_loaded_provider(void)
{
const char *name = "p_test";
@ -76,7 +71,7 @@ static int test_loaded_provider(void)
int setup_tests(void)
{
ADD_TEST(test_builtin_provider);
#ifndef OPENSSL_NO_DSO
#ifndef OPENSSL_NO_MODULE
ADD_TEST(test_loaded_provider);
#endif
return 1;

View file

@ -11,12 +11,6 @@
#include <openssl/provider.h>
#include "testutil.h"
#if !defined(DSO_VMS) && !defined(DSO_DLCFN) && !defined(DSO_DL) \
&& !defined(DSO_WIN32) && !defined(DSO_DLFCN)
# define OPENSSL_NO_DSO
#endif
extern OSSL_provider_init_fn PROVIDER_INIT_FUNCTION_NAME;
static char buf[256];
@ -55,7 +49,7 @@ static int test_builtin_provider(void)
&& test_provider(name);
}
#ifndef OPENSSL_NO_DSO
#ifndef OPENSSL_NO_MODULE
static int test_loaded_provider(void)
{
const char *name = "p_test";
@ -67,7 +61,7 @@ static int test_loaded_provider(void)
int setup_tests(void)
{
ADD_TEST(test_builtin_provider);
#ifndef OPENSSL_NO_DSO
#ifndef OPENSSL_NO_MODULE
ADD_TEST(test_loaded_provider);
#endif
return 1;