Rework Makefile to use regress framework and link asn1basic statically.
authortb <tb@openbsd.org>
Wed, 12 Jan 2022 07:55:25 +0000 (07:55 +0000)
committertb <tb@openbsd.org>
Wed, 12 Jan 2022 07:55:25 +0000 (07:55 +0000)
It will need this for testing {d2i,i2d}_ASN1_BOOLEAN which will be
moved to internal-only in the upcoming bump.

regress/lib/libcrypto/asn1/Makefile
regress/lib/libcrypto/asn1/asn1basic.c

index ce49c0a..1781751 100644 (file)
@@ -1,6 +1,6 @@
-#      $OpenBSD: Makefile,v 1.12 2021/12/24 08:31:55 jsing Exp $
+#      $OpenBSD: Makefile,v 1.13 2022/01/12 07:55:25 tb Exp $
 
-TESTS = \
+PROGS = \
        asn1api \
        asn1basic \
        asn1complex \
@@ -11,20 +11,20 @@ TESTS = \
        rfc5280time \
        string_table
 
-PROGS = ${TESTS}
-
-REGRESS_TARGETS= all_tests
-
-LDADD=         -lcrypto
-DPADD=         ${LIBCRYPTO} ${LIBSSL}
+DPADD+=                ${LIBCRYPTO} ${LIBSSL}
 WARNINGS=      Yes
 LDFLAGS+=      -lcrypto
 CFLAGS+=       -DLIBRESSL_INTERNAL -Wall -Wundef -Werror
+CFLAGS+=       -I${.CURDIR}/../../../../lib/libcrypto/asn1
+CFLAGS+=       -I${.CURDIR}/../../../../lib/libcrypto/bytestring
+
+LDADD_asn1basic = ${CRYPTO_INT}
+
+.for p in ${PROGS}
+REGRESS_TARGETS +=     run-$p
 
-all_tests: ${TESTS}
-       @for test in $>; do \
-               echo "\n======== $$test ========"; \
-               ./$$test; \
-       done
+run-$p: $p
+       @./$p
+.endfor
 
 .include <bsd.regress.mk>
index c879ee6..6b3c72f 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: asn1basic.c,v 1.3 2022/01/06 15:21:33 jsing Exp $ */
+/* $OpenBSD: asn1basic.c,v 1.4 2022/01/12 07:55:25 tb Exp $ */
 /*
  * Copyright (c) 2017, 2021 Joel Sing <jsing@openbsd.org>
  *
@@ -21,6 +21,8 @@
 #include <stdio.h>
 #include <string.h>
 
+#include "asn1_locl.h"
+
 static void
 hexdump(const unsigned char *buf, size_t len)
 {