# @(#)Makefile	1.22 98/07/15
#
# Makefile for running X.509 regression tests, in non-harness mode.
#
# Builds tests in this directory, and expects the JDK to have already
# been built.  See "Harness.html" for details about what's tested,
# not tested, and so on.  Normally one would expect that an automatic
# test harness would be used for all regression tests.
#

TEST_BUILD =	../../../../../../build
TEST_PLATFORM = solaris

XPATH =		$(TEST_BUILD)/$(TEST_PLATFORM)/classes:.
CERT_DIR =	certs

JAVA =		$(TEST_BUILD)/$(TEST_PLATFORM)/bin/java -classpath $(XPATH)
JAVAC =		$(TEST_BUILD)/$(TEST_PLATFORM)/bin/javac


default:	all

all:		rsa-subset dsa-subset


################################

COMMANDS = Base64CertPrint.class BigIntTest.class \
	CRLTest.class CSRParse.class CertAttrTest.class \
	CertGen.class CertParse.class \
	DateFormatTest.class \
	ExtGetTest.class ExtensionsTest.class \
	HexStrToX509Cert.class \
	PKCS10Test.class PKCS10Test1.class \
	PKCS7CertPrint.class PKCS7DerPrint.class PKCS7SignerOrder.class \
	SimpleSigner.class \
	V1toV3Cert.class V3CertInfo.class V3Certificate.class \
	ValidityTest.class \
	X509CRLPrint.class X509CertPrint.class

PARSE =	$(JAVA) CertParse
GEN =	$(JAVA) CertGen

%.class : %.java
	$(JAVAC) $<

clean ::
	-rm -f *.class


################################

tests:	$(COMMANDS)

################################

rsa-subset:	$(COMMANDS)
	@echo "** RSA Certificate Tests"
	@echo ''
	@echo "POSITIVE cert parse/verify tests"
	-@$(PARSE) $(CERT_DIR)/entrust.cer pass
	-@$(PARSE) $(CERT_DIR)/nortel.cer pass
	@echo ''
	@echo "POSITIVE cert chain parse/verify tests"
	-@$(PARSE) $(CERT_DIR)/incog2.cer $(CERT_DIR)/incog1.cer pass
	@echo ''
	@echo "POSITIVE cert generation tests"
	-@$(GEN) RSA MD5withRSA
	-@$(GEN) RSA MD2withRSA
	@echo ''
	@echo "NEGATIVE cert parse/verify tests"
	-@$(PARSE) $(CERT_DIR)/pemlkm.cer fail
	@echo ''
	@echo "NEGATIVE cert chain parse/verify tests"
	-@$(PARSE) $(CERT_DIR)/mit.cer fail
	-@$(PARSE) $(CERT_DIR)/rajaram.cer fail
	@echo ''


################################

dsa-subset:	$(COMMANDS)
	@echo "** DSS/DSA Certificate Tests"
	@echo ''
	@echo "POSITIVE cert generation tests"
	-@$(GEN) DSA SHAwithDSA
	@echo ''
	@echo "NEGATIVE cert parse/verify tests"
	-@$(PARSE) $(CERT_DIR)/dave.cer fail
	-@$(PARSE) $(CERT_DIR)/incog-dsa-ca.cer fail
	-@$(PARSE) $(CERT_DIR)/zap2.cer fail
	@echo ''
