## 
## Copyright (C) 2000-2001 Iowa State University
## 
## This file is part of mjc, the MultiJava Compiler.
## 
## based in part on work:
## 
## Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##
## Author: David R. Cok
## $Id: Makefile,v 1.9 2004/04/17 20:39:29 davidcok Exp $
##

## ----------------------------------------------------------------- 
## At the bottom of this file we import $(TOPDIR)/Make.ProjDefs.  See the
## that file for substantial documentation.
## ----------------------------------------------------------------- 

TOPDIR =	../../../..

PACKAGE =	org/multijava/mjdoc/testcase

SUBDIRS = 	misc2 ## doclettest misc todd # !FIXME!make-dirs
TESTDIRS = 	misc2 ## doclettest misc todd # !FIXME!make-dirs


## ----------------------------------------------------------------------
## GOALS

default:	build buildtests

# Clean up stuff
#
clean-this:     simple-clean local-clean

local-clean:
	-$(RM) `cat .cvsignore`

NO_LOCAL_TESTS = 1

runtests-this: check

check:	runtests-this-start open-test mkdir-test runtests-this-end

open-test:
	@echo Checking $@ ...
	@echo ... err
	@rm -rf tmp
	@mkdir tmp
	@-$(MJDOC) -classpath . -d tmp -private open --fcns x > open.1ckd 2>&1 || true
	@-diff open.1ckd open.err-expected || echo Diff in err test
	@echo ... default
	@-$(MJDOC) -classpath . -d tmp -private open 2>&1 | $(FIXTILT) > open.2ckd
	@-diff open.2ckd open.expected || echo Diff in default test
	@echo ... none
	@-$(MJDOC) -classpath . -d tmp -private open --fcns none 2>&1 | $(FIXTILT) > open.3ckd
	@-diff open.3ckd open.none-expected || echo Diff in none test
	@echo ... ext
	@-$(MJDOC) -classpath . -d tmp -private open --fcns ext 2>&1 | $(FIXTILT) > open.ckd
	@-diff open.ckd open.ext-expected || echo Diff in ext test
	@echo ... all
	@echo skipping test for all fcns

#$(MJDOC) -private open --fcns all > open.ckd 2>&1
#@-diff open.ckd open.all-expected

mkdir-test:
	@echo Checking $@ ...
	@rm -rf tmp
	@$(MJDOC) open/C.java -d tmp/a > /tmp/x1 2>&1
	@rm -rf tmp
	@touch tmp
	@-$(MJDOC) open/C.java -d tmp/a > /tmp/x2 2>&1 || true
	@rm -rf tmp
	@mkdir tmp
	@chmod -w tmp
	@-$(MJDOC) open/C.java -d tmp/a > /tmp/x3 2>&1 || true
	@rm -rf tmp
	@mkdir tmp
	@mkdir tmp/a
	@chmod -w tmp/a
	@-$(MJDOC) open/C.java -d tmp/a > /tmp/x4 2>&1 || true
	@rm -rf tmp

## ----------------------------------------------------------------------
## GLOBAL DEFINITIONS

include $(TOPDIR)/Make.ProjDefs

JDLINKS = -link http://java.sun.com/j2se/1.3/docs/api/
