+2023-10-03 Niels Möller <nisse@lysator.liu.se>
+
+ * testsuite/Makefile.in (TS_SH): Delete tools tests from list.
+ * tools/Makefile.in (check): Run tools tests from this target.
+ (TS_ALL): New variable.
+ (DISTFILES): Add TS_ALL files.
+ * testsuite/teardown-env: Deleted, intead let make clean delete
+ test files.
+ * tools/nettle-pbkdf2-test: Moved, from testseuite/.
+ * tools/sexp-conv-test: Likewise.
+ * tools/pkcs1-conv-test: Likewise.
+
2023-08-02 Niels Möller <nisse@lysator.liu.se>
* configure.ac: Replace obsoleted macros, require autoconf-2.69,
TS_C = $(TS_NETTLE) @IF_HOGWEED@ $(TS_HOGWEED)
TS_CXX = @IF_CXX@ $(CXX_SOURCES:.cxx=$(EXEEXT))
TARGETS = $(TS_C) $(TS_CXX)
-TS_SH = sexp-conv-test pkcs1-conv-test nettle-pbkdf2-test symbols-test
+TS_SH = symbols-test
TS_ALL = $(TARGETS) $(TS_SH) @IF_DLOPEN_TEST@ dlopen-test$(EXEEXT)
EXTRA_SOURCES = sha1-huge-test.c
EXTRA_TARGETS = $(EXTRA_SOURCES:.c=$(EXEEXT))
SOURCES = $(TS_SOURCES) $(EXTRA_SOURCES) testutils.c dlopen-test.c
DISTFILES = $(SOURCES) $(CXX_SOURCES) Makefile.in \
- $(TS_SH) teardown-env \
- gold-bug.txt testutils.h sha3.awk
+ $(TS_SH) gold-bug.txt testutils.h sha3.awk
all: $(EXTRA_TARGETS)
EMULATOR="$(EMULATOR)" NM="$(NM)" EXEEXT="$(EXEEXT)" \
$(top_srcdir)/run-tests $(TS_ALL)
-
Makefile: $(srcdir)/Makefile.in ../config.status
cd .. && $(SHELL) ./config.status testsuite/$@
clean:
-rm -f $(TARGETS) $(EXTRA_TARGETS) dlopen-test$(EXEEXT) \
- *.$(OBJEXT) *.$(OBJEXT).d test.in test1.out test2.out
+ *.$(OBJEXT) *.$(OBJEXT).d test1.out
distclean: clean
-rm -f Makefile *.d
+++ /dev/null
-#! /bin/sh
-
-rm -rf testkey.priv testkey.pub testtmp testsignature testsignature2
nettle-lfib-stream$(EXEEXT) \
@IF_HOGWEED@ $(HOGWEED_TARGETS)
+TS_ALL = sexp-conv-test pkcs1-conv-test nettle-pbkdf2-test
+
all: $(TARGETS)
getopt_OBJS = ../getopt.$(OBJEXT) ../getopt1.$(OBJEXT)
SOURCES = $(sexp_conv_SOURCES) nettle-hash.c nettle-lfib-stream.c pkcs1-conv.c nettle-pbkdf2.c
-DISTFILES = $(SOURCES) Makefile.in input.h misc.h output.h parse.h
+DISTFILES = $(SOURCES) $(TS_ALL) Makefile.in input.h misc.h output.h parse.h
sexp_conv_OBJS = $(sexp_conv_SOURCES:.c=.$(OBJEXT)) $(getopt_OBJS)
sexp-conv$(EXEEXT): $(sexp_conv_OBJS) ../libnettle.stamp
Makefile: $(srcdir)/Makefile.in ../config.status
cd .. && $(SHELL) ./config.status tools/$@
-check:
- true
+check: $(TS_ALL)
+ TEST_SHLIB_DIR="$(TEST_SHLIB_DIR)" \
+ srcdir="$(srcdir)" \
+ EMULATOR="$(EMULATOR)" EXEEXT="$(EXEEXT)" \
+ $(top_srcdir)/run-tests $(TS_ALL)
+
install: $(TARGETS)
$(MKDIR_P) $(DESTDIR)$(bindir)
cp $? $(distdir)
clean:
- -rm -f $(TARGETS) *.$(OBJEXT) *.$(OBJEXT).d
+ -rm -f $(TARGETS) *.$(OBJEXT) *.$(OBJEXT).d test.in test1.out test2.out \
+ testkey.priv testkey.pub testtmp testsignature testsignature2
distclean: clean
-rm -f Makefile *.d
# Delete carriage return characters, needed when testing with
# wine.
- printf "%s" "$password" | $EMULATOR ../tools/nettle-pbkdf2 \
+ printf "%s" "$password" | $EMULATOR ./nettle-pbkdf2 \
-i "$iters" -l "$length" "$salt" | tr -d '\r' > test1.out
echo "$expected" | tr -d '\r' > test2.out
srcdir=`pwd`
fi
-[ -x ../tools/pkcs1-conv$EXEEXT ] || exit 77
+[ -x ./pkcs1-conv$EXEEXT ] || exit 77
# Private RSA key, generated by openssl
-$EMULATOR ../tools/pkcs1-conv >testkey.priv <<EOF || exit 1
+$EMULATOR ./pkcs1-conv >testkey.priv <<EOF || exit 1
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQC3792bBgQ/mc8aYOFaLEJES/JipmLAeVgznob/Vrzvdcx+bl6L
6gTphctU9ToOLC049dZYW3DJ53owUmbQgqB0vvLTjM9lGSEw4oXLrp7x/XVo/fZM
-----END RSA PRIVATE KEY-----
EOF
-$EMULATOR ../tools/pkcs1-conv >testkey.pub <<EOF || exit 1
+$EMULATOR ./pkcs1-conv >testkey.pub <<EOF || exit 1
# Corresponding public key
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC3792bBgQ/mc8aYOFaLEJES/Ji
test_advanced () {
print_raw "$1" test.in
- if $EMULATOR ../tools/sexp-conv -s advanced <test.in | tr -d '\r' >test1.out ; then
+ if $EMULATOR ./sexp-conv -s advanced <test.in | tr -d '\r' >test1.out ; then
true
else
exit 1
test_advanced_hex () {
print_raw "$1" test.in
- if $EMULATOR ../tools/sexp-conv -s hex <test.in | tr -d '\r' >test1.out ; then
+ if $EMULATOR ./sexp-conv -s hex <test.in | tr -d '\r' >test1.out ; then
true
else
exit 1
test_transport () {
print_raw "$1" test.in
- if $EMULATOR ../tools/sexp-conv -s transport <test.in | tr -d '\r' >test1.out ; then
+ if $EMULATOR ./sexp-conv -s transport <test.in | tr -d '\r' >test1.out ; then
true
else
exit 1
test_canonical () {
print_raw "$1" test.in
- if $EMULATOR ../tools/sexp-conv -s canonical <test.in >test1.out ; then
+ if $EMULATOR ./sexp-conv -s canonical <test.in >test1.out ; then
true
else
exit 1
test_advanced '3:foo' 'foo'
test_advanced '12:fooooooooooo' 'fooooooooooo'
test_advanced '10:fooooooooo' 'fooooooooo'
-test_advanced '4:3des' '"3des"'
-test_advanced '"foo"' 'foo'
+test_advanced '4:3des' '"3des"'
+test_advanced '"foo"' 'foo'
test_advanced '4:foo
' '"foo\n"'
# Having the string end with a \ breaks with sysv echo. \x seems harmless.
-test_advanced '3:"\x' '"\"\\x"'
-test_advanced '()' '()'
+test_advanced '3:"\x' '"\"\\x"'
+test_advanced '()' '()'
test_advanced '(foo bar baz)' '(foo bar
- baz)'
+ baz)'
test_advanced '; comment
()' '; comment
-()'
+()'
test_advanced '(foo ; gazonk
bar)' '(foo ; gazonk
bar)'
test_canonical 'foo' '3:foo'
test_canonical 'fooooooooooo' '12:fooooooooooo'
test_canonical 'fooooooooo' '10:fooooooooo'
-test_canonical '(foo bar baz)' '(3:foo3:bar3:baz)'
-test_canonical '{KDM6Zm9vMzpiYXIzOmJheik=}' '(3:foo3:bar3:baz)'
+test_canonical '(foo bar baz)' '(3:foo3:bar3:baz)'
+test_canonical '{KDM6Zm9vMzpiYXIzOmJheik=}' '(3:foo3:bar3:baz)'
exit 0