From: tb Date: Wed, 12 Jan 2022 07:55:25 +0000 (+0000) Subject: Rework Makefile to use regress framework and link asn1basic statically. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9773c5c8135fce1eb8043429f2ca673fbdfc15f5;p=openbsd 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. --- diff --git a/regress/lib/libcrypto/asn1/Makefile b/regress/lib/libcrypto/asn1/Makefile index ce49c0a9c0d..17817514acf 100644 --- a/regress/lib/libcrypto/asn1/Makefile +++ b/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/regress/lib/libcrypto/asn1/asn1basic.c b/regress/lib/libcrypto/asn1/asn1basic.c index c879ee63294..6b3c72f9757 100644 --- a/regress/lib/libcrypto/asn1/asn1basic.c +++ b/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) {