# "Make.test-guile"
#	vi: ft=automake
#	$Id: Make.test-guile,v 1.19 2009/04/29 22:05:40 fang Exp $
# This is just a portion of the Make.test-tail template included by
# Makefile.am's in the test/ directory subtree.  
# This depends on variables defined in Make.test-tail, and thus, 
# should not be included by itself.  

HACKT_GUILE_SUFFIXES = \
	.hacscm .hacscm-out .hacscmfail-out .hacscm-diff .hacscmfail-diff \
	.hacchpsimscm .hacchpsimscm-out .hacchpsimscmfail-out \
	.hacchpsimscm-diff .hacchpsimscmfail-diff
HACKT_GUILE_TEST_SUFFIXES = \
	.hacscmtest .hacscmfailtest \
	.hacchpsimscmtest .hacchpsimscmfailtest
SUFFIXES += $(HACKT_GUILE_SUFFIXES) $(HACKT_GUILE_TEST_SUFFIXES)
BOGUS_SUFFIX_TARGETS += $(HACKT_GUILE_SUFFIXES)

HACKT_GUILE_CLEAN_IGNORE_PATTERNS = \
	"*.hacscm-out" \
	"*.hacscm-out-nosize" \
	"*.hacscm-diff" \
	"*.hacscm-expect-filter" \
	"*.hacscmtest" \
	"*.hacscmfail-out" \
	"*.hacscmfail-diff" \
	"*.hacscmfail-diff-orig" \
	"*.hacscmfailtest" \
	"*.hacchpsimscm-out" \
	"*.hacchpsimscm-out-nosize" \
	"*.hacchpsimscm-diff" \
	"*.hacchpsimscm-diff-nosize" \
	"*.hacchpsimscm-diff-orig" \
	"*.hacchpsimscm-expect-nosize" \
	"*.hacchpsimscmtest" \
	"*.hacchpsimscmfail-out" \
	"*.hacchpsimscmfail-diff" \
	"*.hacchpsimscmfailtest"

AUTO_IGNORE += $(HACKT_GUILE_CLEAN_IGNORE_PATTERNS)

# second filter added to account for guile-1.6 error differences
HACSCM_OUTPUT_FILTER = \
	$(SED) -e '/module created/s/: [^ ]*[ ]/: \#\#FILE\#\# /g' \
		-e '/^Type "(backtrace)" to get more information/d'

# different versions of guile have slightly different error formats
# This is only used as a backup plan, see rule for .hacscmfail-diff.
HACSCM_EXPECT_FILTER = \
	$(SED) -e '/^In standard input:/,/^$$/d' -e '/^Backtrace:/d'

# append to this to add paths
HACKT_GUILE_LOAD_PATH=$(top_srcdir)/src/scm$(PATH_SEPARATOR)$(srcdir)

# strip spaces that result from appending the Makefile variable
# point search paths to pre-installed libraries
HACSCM_TEST_ENVIRONMENT = \
	GUILE_LOAD_PATH=`$(ECHO) $(HACKT_GUILE_LOAD_PATH) | $(SED) 's/ //g'` \
	LTDL_LIBRARY_PATH=$(PRE_INST_LDPATH)

if BUILD_DARWIN
HACSCM_TEST_ENVIRONMENT += $(LTDL_SHLIBPATH_VAR)=$(PRE_INST_LDPATH)
endif

HACKT_GUILE_ENV_EXE = \
	$(HACSCM_TEST_ENVIRONMENT) $(HACKT_GUILE_EXE)

HACSCM_TEST_SCRIPT =
if HAVE_LIBGUILE
HACSCM_TEST_SCRIPT += \
	obj=`$(CAT) $< | $(EXTRACT_HACO_PIPE)` ; \
	$(ECHO) "$(HACKT_GUILE_ENV_EXE) -b $$obj < $< > $@" ; \
	$(HACKT_GUILE_ENV_EXE) -b "$$obj" < $< 2>&1 | $(HACSCM_OUTPUT_FILTER) > $@
else
	$(ECHO) "Not configured with libguile." > $@
endif

HACSCM_FAIL_TEST_SCRIPT = $(HACSCM_TEST_SCRIPT)

.hacscm.hacscm-out:
	@$(HACSCM_TEST_SCRIPT)

.hacscm.hacscmfail-out:
	-@$(HACSCM_FAIL_TEST_SCRIPT)


HACSCM_DIFF = $(DIFF) -Bbu
HACSCM_DIFF_COMMAND = $(HACSCM_DIFF) $$expect $<
if VERBOSE_CHECK
ECHO_HACSCM_DIFF_COMMAND = $(ECHO) "$(HACSCM_DIFF_COMMAND)"
else
ECHO_HACSCM_DIFF_COMMAND = :
endif


# TODO: introduce filtering scripts and differences
if HAVE_LIBGUILE
.hacscm-out.hacscm-diff:
	@stderr=`$(ECHO) $@ |$(SED) 's/\.hacscm-diff$$/.hacscm-expect/g'`; \
	expect="$(srcdir)/$$stderr" ; \
	$(RM) $@ ; \
	if test -f "$$expect" ; then \
	  $(ECHO_HACSCM_DIFF_COMMAND) ; \
	  $(HACSCM_DIFF_COMMAND) > $@ 2>&1 ; \
	  if test -s $@ ; then \
	    $(ECHO) "$@ is non-empty!" ; \
	  fi ; \
	else $(ECHO) "Missing $$expect." | $(TEE) $@ ; \
	fi ; \
	$(TOUCH) $@

.hacscmfail-out.hacscmfail-diff:
	@stderr=`$(ECHO) $@ |$(SED) 's/\.hacscmfail-diff$$/.hacscm-expect/g'`; \
	expect="$(srcdir)/$$stderr" ; \
	$(RM) $@ ; \
	if test -f "$$expect" ; then \
	  $(ECHO_HACSCM_DIFF_COMMAND) ; \
	  $(HACSCM_DIFF_COMMAND) > $@ 2>&1 ; \
	  if test -s $@ ; then \
	    $(ECHO) "$@ is non-empty!  Trying harder..." ; \
	    $(HACSCM_EXPECT_FILTER) "$$expect" > "$$stderr"-filter ; \
	    $(MV) $@ $@-orig ; \
	    $(HACSCM_DIFF) "$$stderr"-filter $< > $@ 2>&1 ; \
	    if test -s $@ ; then \
	      $(ECHO) "$@ is still non-empty!" ; \
	    else $(ECHO) "Differences resolved." ; \
	    fi ; \
	  fi ; \
	else $(ECHO) "Missing $$expect." | $(TEE) $@ ; \
	fi ; \
	$(TOUCH) $@
else
.hacscm-out.hacscm-diff:
	@$(TOUCH) $@

.hacscmfail-out.hacscmfail-diff:
	@$(TOUCH) $@

endif

if HAVE_LIBGUILE
.hacscm-diff.hacscmtest:
	@$(DEFAULT_DIFF_TEST_SCRIPT)

.hacscmfail-diff.hacscmfailtest:
	@$(DEFAULT_DIFF_TEST_SCRIPT)
else
.hacscm-diff.hacscmtest:
	@$(SKIP_TEST_SCRIPT)

.hacscmfail-diff.hacscmfailtest:
	@$(SKIP_TEST_SCRIPT)
endif

.hacscmtest:
	@$(DUMMY_TEST_SCRIPT)

.hacscmfailtest:
	@$(DUMMY_TEST_SCRIPT)

hacscm-out.autodepend: Makefile
	@$(ECHO) "Generating dependencies $@" ; \
	$(RM) $@ ; \
	list='$(HACKT_GUILE_TEST_SCRIPTS_PASSES)' ; \
	exts='hacscm-out' ; \
	test -z "$$list" || \
	for d in $$list ; do \
	  src=$(srcdir)/$$d.hacscm ; \
	  obj=`$(CAT) "$$src" | $(EXTRACT_HACO_PIPE)` ; \
	  for e in $$exts ; do \
	    target=$$d.$$e ; \
	    $(PRINTF) "$$target " ; \
	  done ; \
	  $(ECHO) ": $$obj" ; \
	done > $@ ; \
	$(TOUCH) $@

-include hacscm-out.autodepend
AUTO_DEPENDS += hacscm-out.autodepend

hacscmfail-out.autodepend: Makefile
	@$(ECHO) "Generating dependencies $@" ; \
	$(RM) $@ ; \
	list='$(HACKT_GUILE_TEST_SCRIPTS_FAILURES)' ; \
	exts='hacscmfail-out' ; \
	test -z "$$list" || \
	for d in $$list ; do \
	  src=$(srcdir)/$$d.hacscm ; \
	  obj=`$(CAT) "$$src" | $(EXTRACT_HACO_PIPE)` ; \
	  for e in $$exts ; do \
	    target=$$d.$$e ; \
	    $(PRINTF) "$$target " ; \
	  done ; \
	  $(ECHO) ": $$obj" ; \
	done > $@ ; \
	$(TOUCH) $@

-include hacscmfail-out.autodepend
AUTO_DEPENDS += hacscmfail-out.autodepend

hacscmtest.autodepend: Makefile
	@$(ECHO) "Generating dependencies $@" ; \
	$(ECHO) "$(HACKT_GUILE_TEST_SCRIPTS_PASSES)" | \
	  $(SPACES_TO_NEWLINE) | $(SORT) -u | \
	  $(AWK) '/.+/ {print $$1 ".hacscm-diff: $$(srcdir)/" $$1 ".hacscm-expect"; }' > $@ ; \
	$(TOUCH) $@

-include hacscmtest.autodepend
AUTO_DEPENDS += hacscmtest.autodepend


hacscmfailtest.autodepend: Makefile
	@$(ECHO) "Generating dependencies $@" ; \
	$(ECHO) "$(HACKT_GUILE_TEST_SCRIPTS_FAILURES)" | \
	  $(SPACES_TO_NEWLINE) | $(SORT) -u | \
	  $(AWK) '/.+/ {print $$1 ".hacscmfail-diff: $$(srcdir)/" $$1 ".hacscm-expect"; }' > $@ ; \
	$(TOUCH) $@

-include hacscmfailtest.autodepend
AUTO_DEPENDS += hacscmfailtest.autodepend

# TESTS_ENVIRONMENT doesn't really apply here because these tests are run
# separately as prerequisites of the actual check loop script.
# Thus we must apply environment variables manually.
# Point the GUILE_LOAD_PATH to the home of scheme modules in the source tree.
HACCHPSIMSCM_TEST_ENVIRONMENT = $(HACSCM_TEST_ENVIRONMENT)

HACKT_CHPSIM_GUILE_ENV_EXE = \
	$(HACCHPSIMSCM_TEST_ENVIRONMENT) $(HACKT_CHPSIM_GUILE_EXE)

# TODO: add filter if needed
HACCHPSIMSCM_TEST_SCRIPT =
if HAVE_LIBGUILE
HACCHPSIMSCM_TEST_SCRIPT += \
	obj=`$(CAT) $< | $(EXTRACT_HACO_PIPE)` ; \
	$(ECHO) "$(HACKT_CHPSIM_GUILE_ENV_EXE) -b $$obj < $< > $@" ; \
	$(HACKT_CHPSIM_GUILE_ENV_EXE) -b "$$obj" < $< > $@ 2>&1
else
HACCHPSIMSCM_TEST_SCRIPT += \
	$(ECHO) "Not configured with libguile." > $@
endif

HACCHPSIMSCM_FAIL_TEST_SCRIPT = $(HACCHPSIMSCM_TEST_SCRIPT)

.hacchpsimscm.hacchpsimscm-out:
	@$(HACCHPSIMSCM_TEST_SCRIPT)

.hacchpsimscm.hacchpsimscmfail-out:
	-@$(HACCHPSIMSCM_FAIL_TEST_SCRIPT)


HACCHPSIMSCM_TEST_DIFF = $(DIFF) -bu
if VERBOSE_CHECK
ECHO_HACCHPSIMSCM_DIFF_COMMAND = $(ECHO) "$(HACCHPSIMSCM_TEST_DIFF) -bu $$expect $<"
else
ECHO_HACCHPSIMSCM_DIFF_COMMAND = :
endif

# additional heuristic checking for trivial differences
if ABI_ILP32
CHPSIM_GUILE_TRACE_DUMP_FILTER_SCRIPT = :
else
CHPSIM_GUILE_TRACE_DUMP_FILTER_SCRIPT = \
	$(ECHO) "Filtering out binary trace differences in $@ ..." ; \
	filtered=`$(ECHO) $@ | $(SED) 's/\.hacchpsimscm-diff$$/.hacchpsimscm-expect-nosize/g'` ; \
	diffout=`$(ECHO) $@ | $(SED) 's/\.hacchpsimscm-diff$$/.hacchpsimscm-diff-nosize/g'` ; \
	$(CAT) "$$expect" | $(CHPSIM_TRACE_BINARY_FILTER) > "$$filtered" ; \
	$(CAT) $< | $(CHPSIM_TRACE_BINARY_FILTER) > $<-nosize ; \
	$(HACCHPSIMSCM_TEST_DIFF) "$$filtered" $<-nosize > "$$diffout" 2>&1 ; \
	if test -s "$$diffout" ; then \
	  $(ECHO) "Non-trace differences remain!" ; \
	else \
	  $(ECHO) "Binary trace differences resolved." ; \
	  $(MV) $@ $@-orig ; \
	  $(CP) "$$diffout" $@ ; \
	fi
endif


# TODO: introduce filtering scripts and differences
if HAVE_LIBGUILE
.hacchpsimscm-out.hacchpsimscm-diff:
	@stderr=`$(ECHO) $@ |$(SED) 's/\.hacchpsimscm-diff$$/.hacchpsimscm-expect/g'`; \
	expect="$(srcdir)/$$stderr" ; \
	$(RM) $@ ; \
	if test -f "$$expect" ; then \
	  $(ECHO_HACCHPSIMSCM_DIFF_COMMAND) ; \
	  $(HACCHPSIMSCM_TEST_DIFF) "$$expect" $< > $@ 2>&1 ; \
	  if test -s $@ ; then \
	    $(ECHO) "$@ is non-empty!" ; \
	    $(CHPSIM_GUILE_TRACE_DUMP_FILTER_SCRIPT) ; \
	  fi ; \
	else $(ECHO) "Missing $$expect." | $(TEE) $@ ; \
	fi ; \
	$(TOUCH) $@

.hacchpsimscmfail-out.hacchpsimscmfail-diff:
	@stderr=`$(ECHO) $@ |$(SED) 's/\.hacchpsimscmfail-diff$$/.hacchpsimscm-expect/g'`; \
	expect="$(srcdir)/$$stderr" ; \
	$(RM) $@ ; \
	if test -f "$$expect" ; then \
	  $(ECHO_HACCHPSIMSCM_DIFF_COMMAND) ; \
	  $(HACCHPSIMSCM_TEST_DIFF) "$$expect" $< > $@ 2>&1 ; \
	  if test -s $@ ; then \
	    $(ECHO) "$@ is non-empty!" ; \
	  fi ; \
	else $(ECHO) "Missing $$expect." | $(TEE) $@ ; \
	fi ; \
	$(TOUCH) $@
else
.hacchpsimscm-out.hacchpsimscm-diff:
	@$(TOUCH) $@

.hacchpsimscmfail-out.hacchpsimscmfail-diff:
	@$(TOUCH) $@

endif

if HAVE_LIBGUILE
.hacchpsimscm-diff.hacchpsimscmtest:
	@$(DEFAULT_DIFF_TEST_SCRIPT)

.hacchpsimscmfail-diff.hacchpsimscmfailtest:
	@$(DEFAULT_DIFF_TEST_SCRIPT)
else
.hacchpsimscm-diff.hacchpsimscmtest:
	@$(SKIP_TEST_SCRIPT)

.hacchpsimscmfail-diff.hacchpsimscmfailtest:
	@$(SKIP_TEST_SCRIPT)
endif

.hacchpsimscmtest:
	@$(DUMMY_TEST_SCRIPT)

.hacchpsimscmfailtest:
	@$(DUMMY_TEST_SCRIPT)

# NOTE: optional extra dependence on generated tracefile from other test
hacchpsimscm-out.autodepend: Makefile
	@$(ECHO) "Generating dependencies $@" ; \
	$(RM) $@ ; \
	rlist='$(HACKT_CHPSIM_GUILE_RANDOM_TEST_SCRIPTS_PASSES)' ; \
	list='$(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_PASSES)'" $$rlist" ; \
	exts='hacchpsimscm-out' ; \
	test -z "$$list" || \
	for d in $$list ; do \
	  src=$(srcdir)/$$d.hacchpsimscm ; \
	  obj=`$(CAT) "$$src" | $(EXTRACT_HACO_PIPE)` ; \
	  obj="$$obj "`$(CAT) "$$src" | $(EXTRACT_CHPSIMTRACE_PIPE)` ; \
	  for e in $$exts ; do \
	    target=$$d.$$e ; \
	    $(PRINTF) "$$target " ; \
	  done ; \
	  $(ECHO) ": $$obj" ; \
	done > $@ ; \
	$(TOUCH) $@

-include hacchpsimscm-out.autodepend
AUTO_DEPENDS += hacchpsimscm-out.autodepend

hacchpsimscmfail-out.autodepend: Makefile
	@$(ECHO) "Generating dependencies $@" ; \
	$(RM) $@ ; \
	rlist='$(HACKT_CHPSIM_GUILE_RANDOM_TEST_SCRIPTS_FAILURES)' ; \
	list='$(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_FAILURES)'" $$rlist" ; \
	exts='hacchpsimscmfail-out' ; \
	test -z "$$list" || \
	for d in $$list ; do \
	  src=$(srcdir)/$$d.hacchpsimscm ; \
	  obj=`$(CAT) "$$src" | $(EXTRACT_HACO_PIPE)` ; \
	  obj="$$obj "`$(CAT) "$$src" | $(EXTRACT_CHPSIMTRACE_PIPE)` ; \
	  for e in $$exts ; do \
	    target=$$d.$$e ; \
	    $(PRINTF) "$$target " ; \
	  done ; \
	  $(ECHO) ": $$obj" ; \
	done > $@ ; \
	$(TOUCH) $@

-include hacchpsimscmfail-out.autodepend
AUTO_DEPENDS += hacchpsimscmfail-out.autodepend

hacchpsimscmtest.autodepend: Makefile
	@$(ECHO) "Generating dependencies $@" ; \
	{ $(ECHO) "$(HACKT_CHPSIM_GUILE_RANDOM_TEST_SCRIPTS_PASSES)" ; \
	  $(ECHO) "$(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_PASSES)" ;} | \
	  $(SPACES_TO_NEWLINE) | $(SORT) -u | \
	  $(AWK) '/.+/ {print $$1 ".hacchpsimscm-diff: $$(srcdir)/" $$1 ".hacchpsimscm-expect"; }' > $@ ; \
	$(TOUCH) $@

-include hacchpsimscmtest.autodepend
AUTO_DEPENDS += hacchpsimscmtest.autodepend


hacchpsimscmfailtest.autodepend: Makefile
	@$(ECHO) "Generating dependencies $@" ; \
	{ $(ECHO) "$(HACKT_CHPSIM_GUILE_RANDOM_TEST_SCRIPTS_FAILURES)" ; \
	  $(ECHO) "$(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_FAILURES)" ;} | \
	  $(SPACES_TO_NEWLINE) | $(SORT) -u | \
	  $(AWK) '/.+/ {print $$1 ".hacchpsimscmfail-diff: $$(srcdir)/" $$1 ".hacchpsimscm-expect"; }' > $@ ; \
	$(TOUCH) $@

-include hacchpsimscmfailtest.autodepend
AUTO_DEPENDS += hacchpsimscmfailtest.autodepend


BOGUS_TESTS += .hacscmtest .hacscmfailtest
BOGUS_TESTS += .hacchpsimscmtest .hacchpsimscmfailtest

CHECK_SUMMARIES += hacscmdiffs hacscmfaildiffs
CHECK_SUMMARIES += hacchpsimscmdiffs hacchpsimscmfaildiffs

hacscmdiffs: force
	-$(CAT) *.hacscm-diff > $@

hacscmfaildiffs: force
	-$(CAT) *.hacscmfail-diff > $@

hacchpsimscmdiffs: force
	-$(CAT) *.hacchpsimscm-diff > $@

hacchpsimscmfaildiffs: force
	-$(CAT) *.hacchpsimscmfail-diff > $@


HACKT_GUILE_TEST_SCRIPTS_BASES = \
	$(HACKT_GUILE_TEST_SCRIPTS_PASSES) \
	$(HACKT_GUILE_TEST_SCRIPTS_FAILURES)

HACKT_CHPSIM_GUILE_TEST_SCRIPTS_BASES = \
	$(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_PASSES) \
	$(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_FAILURES)

HACKT_CHPSIM_GUILE_RANDOM_TEST_SCRIPTS_BASES = \
	$(HACKT_CHPSIM_GUILE_RANDOM_TEST_SCRIPTS_PASSES) \
	$(HACKT_CHPSIM_GUILE_RANDOM_TEST_SCRIPTS_FAILURES)

srcdir_EXTRA_DIST += \
	$(HACKT_GUILE_TEST_SCRIPTS_BASES:=.hacscm) \
	$(HACKT_GUILE_TEST_SCRIPTS_BASES:=.hacscm-expect) \
	$(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_BASES:=.hacchpsimscm) \
	$(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_BASES:=.hacchpsimscm-expect) \
	$(HACKT_CHPSIM_GUILE_RANDOM_TEST_SCRIPTS_BASES:=.hacchpsimscm) \
	$(HACKT_CHPSIM_GUILE_RANDOM_TEST_SCRIPTS_BASES:=.hacchpsimscm-expect)

if CHECK_TESTS
TESTS += \
	$(HACKT_GUILE_TEST_SCRIPTS_PASSES:=.hacscmtest) \
	$(HACKT_GUILE_TEST_SCRIPTS_FAILURES:=.hacscmfailtest) \
	$(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_PASSES:=.hacchpsimscmtest) \
	$(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_FAILURES:=.hacchpsimscmfailtest)

if RANDOM_TESTS
TESTS += \
	$(HACKT_CHPSIM_RANDOM_GUILE_TEST_SCRIPTS_PASSES:=.hacchpsimscmtest) \
	$(HACKT_CHPSIM_RANDOM_GUILE_TEST_SCRIPTS_FAILURES:=.hacchpsimscmfailtest)
endif
endif

HAC_COMPILE_OBJECT_TARGETS += \
	$(HACKT_GUILE_TEST_SUBJECTS:=.haco) \
	$(HACKT_CHPSIM_GUILE_TEST_SUBJECTS:=.haco)
# not bothering with unroll anymore...
HAC_CREATE_OBJECT_TARGETS += \
	$(HACKT_GUILE_TEST_SUBJECTS:=.haco-c) \
	$(HACKT_CHPSIM_GUILE_TEST_SUBJECTS:=.haco-c)
HAC_ALLOC_OBJECT_TARGETS += \
	$(HACKT_GUILE_TEST_SUBJECTS:=.haco-a) \
	$(HACKT_CHPSIM_GUILE_TEST_SUBJECTS:=.haco-a)

GUILE_RANDOM_BUILD_CHECK_LOCAL =
if RANDOM_TESTS
GUILE_RANDOM_BUILD_CHECK_LOCAL += \
	$(HACKT_CHPSIM_GUILE_RANDOM_TEST_SCRIPTS_PASSES:=.hacchpsimscm-out) \
	$(HACKT_CHPSIM_GUILE_RANDOM_TEST_SCRIPTS_PASSES:=.hacchpsimscm-diff) \
	$(HACKT_CHPSIM_GUILE_RANDOM_TEST_SCRIPTS_FAILURES:=.hacchpsimscmfail-out) \
	$(HACKT_CHPSIM_GUILE_RANDOM_TEST_SCRIPTS_FAILURES:=.hacchpsimscmfail-diff)
endif

build-check-local: \
	$(HACKT_GUILE_TEST_SUBJECTS:=.haco-a) \
	$(HACKT_GUILE_TEST_SCRIPTS_PASSES:=.hacscm-out) \
	$(HACKT_GUILE_TEST_SCRIPTS_PASSES:=.hacscm-diff) \
	$(HACKT_GUILE_TEST_SCRIPTS_FAILURES:=.hacscmfail-out) \
	$(HACKT_GUILE_TEST_SCRIPTS_FAILURES:=.hacscmfail-diff) \
	$(HACKT_CHPSIM_GUILE_TEST_SUBJECTS:=.haco-a) \
	$(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_PASSES:=.hacchpsimscm-out) \
	$(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_PASSES:=.hacchpsimscm-diff) \
	$(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_FAILURES:=.hacchpsimscmfail-out) \
	$(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_FAILURES:=.hacchpsimscmfail-diff) \
	$(GUILE_RANDOM_BUILD_CHECK_LOCAL)

HACKT_GUILE_OUT = \
	$(HACKT_GUILE_TEST_SUBJECTS:=.hacscm-out) \
	$(HACKT_GUILE_TEST_SUBJECTS:=.hacscmfail-out)

HACKT_CHPSIM_GUILE_OUT = \
	$(HACKT_CHPSIM_GUILE_TEST_SUBJECTS:=.hacchpsimscm-out) \
	$(HACKT_CHPSIM_GUILE_TEST_SUBJECTS:=.hacchpsimscmfail-out)

# no longer a built executable, plug-in dependency in Make.test-guile
# $(HACKT_GUILE_OUT): $(HACKT_GUILE_EXE)
# $(HACKT_CHPSIM_GUILE_OUT): $(HACKT_CHPSIM_GUILE_EXE)

echo-hacscm-passes: force
	@$(ECHO) $(HACKT_GUILE_TEST_SCRIPTS_PASSES)

echo-hacscm-failures: force
	@$(ECHO) $(HACKT_GUILE_TEST_SCRIPTS_FAILURES)

echo-hacchpsimscm-passes: force
	@$(ECHO) $(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_PASSES)

echo-hacchpsimscm-failures: force
	@$(ECHO) $(HACKT_CHPSIM_GUILE_TEST_SCRIPTS_FAILURES)


clean-hacscmtests:
	patternlist='$(HACKT_GUILE_CLEAN_IGNORE_PATTERNS)' ; \
	for p in $$patternlist ; do \
	  pp=`$(ECHO) $$p | $(SED) 's/"//g'` ; \
	  $(RM_PATTERN) "$$pp" ; \
	done

clean-local: clean-hacscmtests

.PHONY: clean-hacscmtests

