 ###########################################################################
 ##                                                                       ##
 ##                Centre for Speech Technology Research                  ##
 ##                     University of Edinburgh, UK                       ##
 ##                         Copyright (c) 1997                            ##
 ##                        All Rights Reserved.                           ##
 ##                                                                       ##
 ##  Permission to use, copy, modify, distribute this software and its    ##
 ##  documentation for research, educational and individual use only, is  ##
 ##  hereby granted without fee, subject to the following conditions:     ##
 ##   1. The code must retain the above copyright notice, this list of    ##
 ##      conditions and the following disclaimer.                         ##
 ##   2. Any modifications must be clearly marked as such.                ##
 ##   3. Original authors' names are not deleted.                         ##
 ##  This software may not be used for commercial purposes without        ##
 ##  specific prior written permission from the authors.                  ##
 ##                                                                       ##
 ##  THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK        ##
 ##  DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING      ##
 ##  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT   ##
 ##  SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE     ##
 ##  FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES    ##
 ##  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN   ##
 ##  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,          ##
 ##  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF       ##
 ##  THIS SOFTWARE.                                                       ##
 ##                                                                       ##
 ###########################################################################
 ##                   Testsuite Directory Makefile                        ##
 ###########################################################################

 # To quickly rebuld the tests:
 #	make
 # To run the tests
 #	make test
 # To run a specific test
 #	make hash_module_build_and_test
 # or just
 #	make hash_module_rebuild
 #	make hash_module_test


TOP=..
DIRNAME=testsuite
ALL_DIRS = data correct

# tests performed by shell scripts
TEST_SCRIPTS = ch_wave ch_track viterbi wagon

# tests performed by C++ programs
#TEST_MODULES = string list hash pathname named_enum track_map token
TEST_MODULES = string hash pathname \
	track token complex list kvl matrix \
	handle

# These don't compile on some systems (due to compiler problems)
OTHERS=sigpr_example.cc sigpr_regression.cc lpc.sh

# define any arguments for the scripts or programs here (for instance
# if they need to be passed the name of a data file).

MODULES = $(TEST_MODULES:%=%_example)
MODULE_TO_DOCXX = perl $(TOP)/scripts/example_to_doc++.prl

hash_regression_args = data/alice

TEST_OPTIMISE=3

# by default we just rebuild the C++ tests to catch typos etc.
ALL = $(TEST_PROGRAMS)
ALL_EXECS = $(TEST_MODULES:%=%_example) $(TEST_MODULES:%=%_regression)
LOCAL_CLEAN = tmp

include $(TOP)/config/test_make_rules

OPTIMISE=$(TEST_OPTIMISE)

LOCAL_DEFINES=-DTVECTOR_BOUNDS_CHECKING

override WARN=1

just_test test: 
	$(MAKE) --no-print-directory $@s 2>&1 | tee .test_out
	@if egrep 'FAILED|INCORRECT|Warning' .test_out >/dev/null;\
		then \
		echo "-------------" ;\
		echo "Tests failed:" ;\
		egrep 'FAILED|INCORRECT|Warning' .test_out ;\
	else \
		echo "-------------" ;\
		echo "Test OK" ;\
	fi
tmpdir:
	rm -rf tmp
	mkdir tmp

tests: tmpdir test_modules test_scripts

just_tests: tmpdir just_test_modules just_test_scripts


