From 707ceb29e04f7199f1ae619a6c0eab866fd15add Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Tue, 12 Nov 2002 11:25:33 +0000 Subject: [PATCH] Make it possible to run individual tests even when linked with libcrypto.so and libssl.so --- test/Makefile.ssl | 93 +++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/test/Makefile.ssl b/test/Makefile.ssl index 34e1a125df..64d87707dd 100644 --- a/test/Makefile.ssl +++ b/test/Makefile.ssl @@ -118,11 +118,10 @@ tests: exe apps $(TESTS) apps: @(cd ..; $(MAKE) DIRS=apps all) -alltests: - (LIBPATH="`cd ..; pwd`"; LD_LIBRARY_PATH=$$LIBPATH; DYLD_LIBRARY_PATH=$$LIBPATH; SHLIB_PATH=$$LIBPATH; \ - export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH; \ - $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' alltests.chooser) -alltests.chooser: \ +SET_SO_PATHS=LIBPATH="`cd ..; pwd`"; LD_LIBRARY_PATH=$$LIBPATH; DYLD_LIBRARY_PATH=$$LIBPATH; SHLIB_PATH=$$LIBPATH; \ + export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH + +alltests: \ test_des test_idea test_sha test_md4 test_md5 test_hmac \ test_md2 test_mdc2 \ test_rmd test_rc2 test_rc4 test_rc5 test_bf test_cast test_rd \ @@ -131,128 +130,128 @@ alltests.chooser: \ test_ss test_ca test_engine test_evp test_ssl test_evp: - ./$(EVPTEST) evptests.txt + $(SET_SO_PATHS); ./$(EVPTEST) evptests.txt test_des: - ./$(DESTEST) + $(SET_SO_PATHS); ./$(DESTEST) test_idea: - ./$(IDEATEST) + $(SET_SO_PATHS); ./$(IDEATEST) test_sha: - ./$(SHATEST) - ./$(SHA1TEST) + $(SET_SO_PATHS); ./$(SHATEST) + $(SET_SO_PATHS); ./$(SHA1TEST) test_mdc2: - ./$(MDC2TEST) + $(SET_SO_PATHS); ./$(MDC2TEST) test_md5: - ./$(MD5TEST) + $(SET_SO_PATHS); ./$(MD5TEST) test_md4: - ./$(MD4TEST) + $(SET_SO_PATHS); ./$(MD4TEST) test_hmac: - ./$(HMACTEST) + $(SET_SO_PATHS); ./$(HMACTEST) test_md2: - ./$(MD2TEST) + $(SET_SO_PATHS); ./$(MD2TEST) test_rmd: - ./$(RMDTEST) + $(SET_SO_PATHS); ./$(RMDTEST) test_bf: - ./$(BFTEST) + $(SET_SO_PATHS); ./$(BFTEST) test_cast: - ./$(CASTTEST) + $(SET_SO_PATHS); ./$(CASTTEST) test_rc2: - ./$(RC2TEST) + $(SET_SO_PATHS); ./$(RC2TEST) test_rc4: - ./$(RC4TEST) + $(SET_SO_PATHS); ./$(RC4TEST) test_rc5: - ./$(RC5TEST) + $(SET_SO_PATHS); ./$(RC5TEST) test_rand: - ./$(RANDTEST) + $(SET_SO_PATHS); ./$(RANDTEST) test_enc: - @sh ./testenc + @$(SET_SO_PATHS); sh ./testenc test_x509: echo test normal x509v1 certificate - sh ./tx509 2>/dev/null + $(SET_SO_PATHS); sh ./tx509 2>/dev/null echo test first x509v3 certificate - sh ./tx509 v3-cert1.pem 2>/dev/null + $(SET_SO_PATHS); sh ./tx509 v3-cert1.pem 2>/dev/null echo test second x509v3 certificate - sh ./tx509 v3-cert2.pem 2>/dev/null + $(SET_SO_PATHS); sh ./tx509 v3-cert2.pem 2>/dev/null test_rsa: - @sh ./trsa 2>/dev/null - ./$(RSATEST) + @$(SET_SO_PATHS); sh ./trsa 2>/dev/null + $(SET_SO_PATHS); ./$(RSATEST) test_crl: - @sh ./tcrl 2>/dev/null + @$(SET_SO_PATHS); sh ./tcrl 2>/dev/null test_sid: - @sh ./tsid 2>/dev/null + @$(SET_SO_PATHS); sh ./tsid 2>/dev/null test_req: - @sh ./treq 2>/dev/null - @sh ./treq testreq2.pem 2>/dev/null + @$(SET_SO_PATHS); sh ./treq 2>/dev/null + @$(SET_SO_PATHS); sh ./treq testreq2.pem 2>/dev/null test_pkcs7: - @sh ./tpkcs7 2>/dev/null - @sh ./tpkcs7d 2>/dev/null + @$(SET_SO_PATHS); sh ./tpkcs7 2>/dev/null + @$(SET_SO_PATHS); sh ./tpkcs7d 2>/dev/null test_bn: @echo starting big number library test, could take a while... - @./$(BNTEST) >tmp.bntest + @$(SET_SO_PATHS); ./$(BNTEST) >tmp.bntest @echo quit >>tmp.bntest @echo "running bc" @) {if (/^test (.*)/) {print STDERR "\nverify $$1";} elsif (!/^0$$/) {die "\nFailed! bc: $$_";} else {print STDERR "."; $$i++;}} print STDERR "\n$$i tests passed\n"' @echo 'test a^b%c implementations' - ./$(EXPTEST) + $(SET_SO_PATHS); ./$(EXPTEST) test_ec: @echo 'test elliptic curves' - ./$(ECTEST) + $(SET_SO_PATHS); ./$(ECTEST) test_verify: @echo "The following command should have some OK's and some failures" @echo "There are definitly a few expired certificates" - -../apps/openssl verify -CApath ../certs ../certs/*.pem + -$(SET_SO_PATHS); ../apps/openssl verify -CApath ../certs ../certs/*.pem test_dh: @echo "Generate a set of DH parameters" - ./$(DHTEST) + $(SET_SO_PATHS); ./$(DHTEST) test_dsa: @echo "Generate a set of DSA parameters" - ./$(DSATEST) - ./$(DSATEST) -app2_1 + $(SET_SO_PATHS); ./$(DSATEST) + $(SET_SO_PATHS); ./$(DSATEST) -app2_1 test_gen: @echo "Generate and verify a certificate request" - @sh ./testgen + @$(SET_SO_PATHS); sh ./testgen test_ss keyU.ss certU.ss certCA.ss: testss @echo "Generate and certify a test certificate" - @sh ./testss + @$(SET_SO_PATHS); sh ./testss test_engine: @echo "Manipulate the ENGINE structures" - ./$(ENGINETEST) + $(SET_SO_PATHS); ./$(ENGINETEST) test_ssl: keyU.ss certU.ss certCA.ss @echo "test SSL protocol" - @sh ./testssl keyU.ss certU.ss certCA.ss + @$(SET_SO_PATHS); sh ./testssl keyU.ss certU.ss certCA.ss test_ca: - @if ../apps/openssl no-rsa; then \ + @$(SET_SO_PATHS); if ../apps/openssl no-rsa; then \ echo "skipping CA.sh test -- requires RSA"; \ else \ echo "Generate and certify a test certificate via the 'ca' program"; \ @@ -261,7 +260,7 @@ test_ca: test_rd: #$(RDTEST) # @echo "test Rijndael" -# ./$(RDTEST) +# $(SET_SO_PATHS); ./$(RDTEST) lint: lint -DLINT $(INCLUDES) $(SRC)>fluff -- 2.25.1