int main(int argc, char *argv[])
{
- int num_failed;
+ int result = 0;
SSL_library_init();
SSL_load_error_strings();
- num_failed = test_dtls1_not_bleeding() +
- test_dtls1_not_bleeding_empty_payload() +
- test_dtls1_heartbleed() +
- test_dtls1_heartbleed_empty_payload() +
- /* The following test causes an assertion failure at
- * ssl/d1_pkt.c:dtls1_write_bytes() in versions prior to 1.0.1g: */
- (OPENSSL_VERSION_NUMBER >= 0x1000107fL ?
- test_dtls1_heartbleed_excessive_plaintext_length() : 0) +
- test_tls1_not_bleeding() +
- test_tls1_not_bleeding_empty_payload() +
- test_tls1_heartbleed() +
- test_tls1_heartbleed_empty_payload() +
- 0;
-
+ ADD_TEST(test_dtls1_not_bleeding);
+ ADD_TEST(test_dtls1_not_bleeding_empty_payload);
+ ADD_TEST(test_dtls1_heartbleed);
+ ADD_TEST(test_dtls1_heartbleed_empty_payload);
+ ADD_TEST(test_dtls1_heartbleed_excessive_plaintext_length);
+ ADD_TEST(test_tls1_not_bleeding);
+ ADD_TEST(test_tls1_not_bleeding_empty_payload);
+ ADD_TEST(test_tls1_heartbleed);
+ ADD_TEST(test_tls1_heartbleed_empty_payload);
+
+ result = run_tests(argv[0]);
ERR_print_errors_fp(stderr);
-
- if (num_failed != 0)
- {
- printf("%d test%s failed\n", num_failed, num_failed != 1 ? "s" : "");
- return EXIT_FAILURE;
- }
- return EXIT_SUCCESS;
+ return result;
}
#else /* OPENSSL_NO_HEARTBEATS*/
$(FIPS_TEST_SUITE).o $(FIPS_DHVS).o $(FIPS_ECDSAVS).o \
$(FIPS_ECDHVS).o $(FIPS_CMACTEST).o $(FIPS_ALGVS).o \
$(EVPTEST).o $(IGETEST).o $(JPAKETEST).o $(V3NAMETEST).o \
- $(GOST2814789TEST).o $(HEARTBEATTEST).o $(P5_CRPT2_TEST).o
+ $(GOST2814789TEST).o $(HEARTBEATTEST).o $(P5_CRPT2_TEST).o \
+ testutil.o
SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \
$(MD2TEST).c $(MD4TEST).c $(MD5TEST).c \
$(FIPS_TEST_SUITE).c $(FIPS_DHVS).c $(FIPS_ECDSAVS).c \
$(FIPS_ECDHVS).c $(FIPS_CMACTEST).c $(FIPS_ALGVS).c \
$(EVPTEST).c $(IGETEST).c $(JPAKETEST).c $(V3NAMETEST).c \
- $(GOST2814789TEST).c $(HEARTBEATTEST).c $(P5_CRPT2_TEST).c
+ $(GOST2814789TEST).c $(HEARTBEATTEST).c $(P5_CRPT2_TEST).c \
+ testutil.c
EXHEADER=
HEADER= $(EXHEADER)
fi; \
LIBRARIES="$(LIBSSL) $(LIBCRYPTO) $(LIBKRB5)"; \
$(MAKE) -f $(TOP)/Makefile.shared -e \
- APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \
+ APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o $$testutil" \
LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \
link_app.$${shlib_target}
BUILD_CMD_STATIC=shlib_target=; \
LIBRARIES="$(DLIBSSL) $(DLIBCRYPTO) $(LIBKRB5)"; \
$(MAKE) -f $(TOP)/Makefile.shared -e \
- APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \
+ APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o $$testutil" \
LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \
link_app.$${shlib_target}
$(V3NAMETEST)$(EXE_EXT): $(V3NAMETEST).o $(DLIBCRYPTO)
@target=$(V3NAMETEST); $(BUILD_CMD)
-$(HEARTBEATTEST)$(EXE_EXT): $(HEARTBEATTEST).o $(DLIBCRYPTO)
- @target=$(HEARTBEATTEST); $(BUILD_CMD_STATIC)
+$(HEARTBEATTEST)$(EXE_EXT): $(HEARTBEATTEST).o $(DLIBCRYPTO) testutil.o
+ @target=$(HEARTBEATTEST) testutil=testutil.o; $(BUILD_CMD_STATIC)
#$(AESTEST).o: $(AESTEST).c
# $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c