# Copyright (C) 2012 The Meme Factory, Inc. http://www.meme.com>/
#
# This file is part of GombeMI.
#
# GombeMI 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 3 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 GombeMI. If not, see .
#
# Regression tests
#
# Karl O. Pinc
#
# This just to test db operation, not creation etc.
include ../defaults.mk
include test.mk
include gentargets.mk
# Trickery so we don't have to make load_file executable.
# (And don't use source (.) because posix won't let it take args.)
export RUN_TEST = sh &2 || e=1 ; \
exit $$e
.PHONY: reset
reset:
@$(MAKE) -s -f run_test.mkf reset 4>&2
.PHONY: $(load_targets) $(test_targets) $(save_targets) $(show_targets) \
$(trans_test_targets) $(trans_save_targets) $(trans_show_targets)
$(load_targets) $(test_targets) $(save_targets) $(show_targets) \
$(trans_test_targets) $(trans_save_targets) $(trans_show_targets):
@$(RUN_TEST) "$@"
.PHONY: test_%
test_%:
@if [ ! -e sql/$(patsubst test_%,%,$@) ] ; then \
printf '$(patsubst test_%,%,$@): No such test\n' >&2 ; \
exit 1 ; \
fi