# DOCK test Makefile.

include ./default_targets.h


# Run all tests silently cleaning first because dependencies are incomplete.
test: silentclean timed_test

# Run all tests without cleaning.
dirtytest: timed_test

# Run DOCK tests
dock:
	cd anchor_and_grow && make test
	cd bump_filter && make test
	cd ligand_io && make test
	cd ligand_orienting && make test
	cd minimization && make test
	cd contact_score && make test
	cd continuous_score && make test
	cd grid_score && make test
	cd zou_gbsa_score && make test
	cd hawkins_gbsa_score && make test
	cd chemgrid_score && make test
	cd primary_secondary_score && make test
	cd amber_score_181l && make test
	cd amber_score_1a28 && make test
	cd amber_score_1lgu && make test
	cd amber_score_multiple_ligands && make test
	cd mpi && make test
	cd pbsa_score && make test

# Run tests on the utilities
utils:
	cd sphere_generation && make test
	cd grid_generation && make test
	cd gbsa_grid_generation && make test
	cd nchemgrid_GB_grid_generation && make test
	cd nchemgrid_SA_grid_generation && make test
	cd solvgrid_generation && make test
	cd chemgrid_generation && make test

timed_test: 
	@echo "Starting validation of "
	@echo ${DOCK_VERSION}
	@echo "at `date`."
	@echo ""
	make utils; make dock
	@echo ""
	@echo "Validation of "
	@echo ${DOCK_VERSION}
	@echo "is complete at `date`."
	@echo ""

# Clean all tests by invoking make clean in all subdirectories that have
# a non-zero-sized Makefile.
clean:
	@( \
	find . -name "Makefile" ! -size 0c -print | grep -v '\./Makefile' | \
	while read path ;\
	do \
	    directory=`dirname $$path` ;\
	    cd $$directory; make clean; cd .. ;\
	done ;\
	)

silentclean:
	@make clean 1> /dev/null 2>&1

