From f7047c5760416fa250d00dbd4dfe54e5bb4702ca Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 12 Jan 2022 07:55:25 +0000 Subject: Rework Makefile to use regress framework and link asn1basic statically. It will need this for testing {d2i,i2d}_ASN1_BOOLEAN which will be moved to internal-only in the upcoming bump. --- src/regress/lib/libcrypto/asn1/Makefile | 26 +++++++++++++------------- src/regress/lib/libcrypto/asn1/asn1basic.c | 4 +++- 2 files changed, 16 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/regress/lib/libcrypto/asn1/Makefile b/src/regress/lib/libcrypto/asn1/Makefile index ce49c0a9c0..17817514ac 100644 --- a/src/regress/lib/libcrypto/asn1/Makefile +++ b/src/regress/lib/libcrypto/asn1/Makefile @@ -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 diff --git a/src/regress/lib/libcrypto/asn1/asn1basic.c b/src/regress/lib/libcrypto/asn1/asn1basic.c index c879ee6329..6b3c72f975 100644 --- a/src/regress/lib/libcrypto/asn1/asn1basic.c +++ b/src/regress/lib/libcrypto/asn1/asn1basic.c @@ -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 * @@ -21,6 +21,8 @@ #include #include +#include "asn1_locl.h" + static void hexdump(const unsigned char *buf, size_t len) { -- cgit v1.2.3-55-g6feb