diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2019-09-05 00:59:37 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2019-09-05 00:59:37 +0000 |
commit | 1c2ff5d3bdd154fd20a62638e70afef5ee946dde (patch) | |
tree | ab3ca0876eaf0264f0c322ec0a3f2ec5919c546d /regress/lib/libcrypto/bn | |
parent | 64f861c6a602f48cd97ee385b60c47c048042174 (diff) |
Feed the bntest output to bc(1). This checks the result of the big
num calculations and avoids lots of ugly output to stdout. Remove
fflush(3) of stderr, it is unbuffered anyway.
with Moritz Buhl
Diffstat (limited to 'regress/lib/libcrypto/bn')
-rw-r--r-- | regress/lib/libcrypto/bn/general/Makefile | 22 | ||||
-rw-r--r-- | regress/lib/libcrypto/bn/general/bntest.c | 7 |
2 files changed, 16 insertions, 13 deletions
diff --git a/regress/lib/libcrypto/bn/general/Makefile b/regress/lib/libcrypto/bn/general/Makefile index d1a73a37693..ca3dcf9b085 100644 --- a/regress/lib/libcrypto/bn/general/Makefile +++ b/regress/lib/libcrypto/bn/general/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.5 2019/04/13 22:06:31 tb Exp $ +# $OpenBSD: Makefile,v 1.6 2019/09/05 00:59:36 bluhm Exp $ .include "../../Makefile.inc" @@ -9,14 +9,22 @@ LDADD = ${CRYPTO_INT} DPADD = ${LIBCRYPTO} WARNINGS = Yes CFLAGS += -Werror +CLEANFILES = bntest.out bc.out -.for p in ${PROGS} -REGRESS_TARGETS += run-$p +REGRESS_TARGETS += run-bntest +run-bntest bntest.out: bntest + @echo '\n======== $@ ========' + ./bntest -out bntest.out -run-$p: $p - ./$p +REGRESS_TARGETS += run-bc +run-bc: bntest.out + @echo '\n======== $@ ========' + bc < bntest.out | tee bc.out | grep -v '^0$$' + ! grep -v '^test ' <bc.out | grep -v '^0$$' -.PHONY: run-$p -.endfor +REGRESS_TARGETS += run-bn_to_string +run-bn_to_string: bn_to_string + @echo '\n======== $@ ========' + ./bn_to_string .include <bsd.regress.mk> diff --git a/regress/lib/libcrypto/bn/general/bntest.c b/regress/lib/libcrypto/bn/general/bntest.c index cff776068b6..138b7673e6b 100644 --- a/regress/lib/libcrypto/bn/general/bntest.c +++ b/regress/lib/libcrypto/bn/general/bntest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bntest.c,v 1.20 2018/07/17 17:06:49 tb Exp $ */ +/* $OpenBSD: bntest.c,v 1.21 2019/09/05 00:59:36 bluhm Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -2028,7 +2028,6 @@ genprime_cb(int p, int n, BN_GENCB *arg) if (p == 3) c = '\n'; putc(c, stderr); - fflush(stderr); return (1); } @@ -2116,11 +2115,9 @@ test_kron(BIO *bp, BN_CTX *ctx) } putc('.', stderr); - fflush(stderr); } putc('\n', stderr); - fflush(stderr); rc = 1; err: BN_free(a); @@ -2207,11 +2204,9 @@ test_sqrt(BIO *bp, BN_CTX *ctx) } putc('.', stderr); - fflush(stderr); } putc('\n', stderr); - fflush(stderr); } rc = 1; err: |