junktesting support


git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@1240 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/examples/sample.source.PKIX1/Makefile b/examples/sample.source.PKIX1/Makefile
index be46949..1a79ca7 100644
--- a/examples/sample.source.PKIX1/Makefile
+++ b/examples/sample.source.PKIX1/Makefile
@@ -345,7 +345,7 @@
 # This file may be used as an input for make(3)
 # Remove the lines below to convert it into a pure .am file
 TARGET = x509dump
-CFLAGS += -DHAVE_CONFIG_H -DPDU=Certificate -I.
+CFLAGS += -DHAVE_CONFIG_H -DJUNKTEST -DPDU=Certificate -I.
 OBJS=${ASN_MODULE_SOURCES:.c=.o} ${ASN_CONVERTER_SOURCES:.c=.o}
 
 all: Certificate.c $(TARGET)
@@ -381,7 +381,12 @@
 	PROGNAME=x509dump \
 	../sample.makefile.regen
 
-check: ${TARGET}
+check: ${TARGET} check-ber check-xer check-per
+	@echo ================
+	@echo All tests passed
+	@echo ================
+
+check-ber:
 	@if test -f sample-Certificate-1.[db]er ; then \
 	for f in sample-Certificate-*.[db]er; do \
 	for b in 1 17 33 980 8192; do \
@@ -390,7 +395,12 @@
 	./${TARGET} -b $$b -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \
 	diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \
 	rm -f ./.tmp.[12].$$$$; \
+	echo "Test junking $$f (please wait)..."; \
+	./${TARGET} -J0.0001 -n 1000 -b $$b -iber -onull $$f || exit 2; \
+	./${TARGET} -J0.001 -n 1000 -b $$b -iber -onull $$f || exit 2; \
 	done; done; fi
+
+check-xer:
 	@if test -f sample-Certificate-1.xer ; then \
 	for f in sample-Certificate-*.xer; do \
 	for b in 1 17 33 980 8192; do \
@@ -399,7 +409,12 @@
 	./${TARGET} -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \
 	diff $$f ./.tmp.2.$$$$ || exit 2; \
 	rm -f ./.tmp.[12].$$$$; \
+	echo "Test junking $$f (please wait)..."; \
+	./${TARGET} -J0.0001 -n 1000 -b $$b -ixer -onull $$f || exit 2; \
+	./${TARGET} -J0.001 -n 1000 -b $$b -ixer -onull $$f || exit 2; \
 	done; done; fi
+
+check-per:
 	@if test -f sample-Certificate-1.per ; then \
 	for f in sample-Certificate-[1-9].per; do \
 	for b in 1 17 33 980 8192; do \
@@ -409,6 +424,9 @@
 	./${TARGET} -b $$b -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 2; \
 	diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 2; \
 	rm -f ./.tmp.[123].$$$$; \
+	echo "Test junking $$f (please wait)..."; \
+	./${TARGET} -J0.0001 -n 1000 -b $$b -iper -onull $$f || exit 2; \
+	./${TARGET} -J0.001 -n 1000 -b $$b -iper -onull $$f || exit 2; \
 	done; done; fi
 	@if test -f sample-Certificate-1-padded.per ; then \
 	for f in sample-*-[1-9]-padded.per; do \
@@ -420,10 +438,10 @@
 	./${TARGET} -b $$b -p $$pdu -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 2; \
 	diff $$f ./.tmp.1.$$$$ || exit 2; \
 	rm -f ./.tmp.[12].$$$$; \
+	echo "Test junking $$f (please wait)..."; \
+	./${TARGET} -J0.0001 -n 1000 -b $$b -per-padded -iper -onull $$f || exit 2; \
+	./${TARGET} -J0.001 -n 1000 -b $$b -per-padded -iper -onull $$f || exit 2; \
 	done; done; fi
-	@echo ================
-	@echo All tests passed
-	@echo ================
 
 distclean: clean
 	rm -f $(ASN_MODULE_SOURCES)