Files
mercury/tests/feedback/Mmakefile
Zoltan Somogyi 2c50256e4a Fix disappearing directories in tests/feedback.
tests/feedback/mandelbrot_dir:
tests/feedback/mmc_dir:
    Add "_dir" suffixes to the names of these two subdirectories.
    The reason is that when doing a bootcheck in the java or C# grades,
    which always use mmc --make, the realclean action we executed
    for each test, mandelbrot and mmc, in this directory,
    deleted these directories, because their names coincided
    with the names of what would have been the executables
    in these tests. (Of course, part of the problem is that
    the realclean action effectively executed "rm -r" instead of
    just "rm" when it *thought* it was removing an executable.)

tests/feedback/Mmakefile:
    Tell the tests to get the deep profiling data files from the
    updated directory names.
2025-09-03 18:10:25 +02:00

66 lines
2.0 KiB
Makefile

#-----------------------------------------------------------------------------#
# vim: ts=8 sw=8 noexpandtab ft=make
#-----------------------------------------------------------------------------#
TESTS_DIR = ..
THIS_DIR = feedback
MAYBE_J1 =
#-----------------------------------------------------------------------------#
PROGS = \
mandelbrot \
mmc
AUTOPAR_REPORTS = $(PROGS)
REPORTS = $(patsubst %,autopar_%,$(AUTOPAR_REPORTS))
TESTS = $(patsubst %,%-nodepend,$(sort $(REPORTS)))
include ../Mmake.common
# Before 2012 Jan 9, we used to always test the versions of
# mdprof_create_feedback and mdprof_report_feedback in the current workspace.
# Then, in commit 66176a407eb71790e8608bc0ee25b15cf67f6ddf, Paul added code
# here to test the installed versions in PATH instead if the current workspace
# did not have these executables. His log message says:
#
# The feedback tests on goliath were failing. The problem is that
# the test suite is run without first building the workspace, and
# the mdprof_create_feedback and tools are not available.
#
# This is why we try to use the feedback tools in this workspace if available;
# and otherwise, we use the tools in $PATH.
FB_CREATE_WS = ../../deep_profiler/mdprof_create_feedback
FB_REPORT_WS = ../../deep_profiler/mdprof_report_feedback
FB_CREATE_SYS = mdprof_create_feedback
FB_REPORT_SYS = mdprof_report_feedback
FB_CREATE = `if test -e $(FB_CREATE_WS); then \
echo $(FB_CREATE_WS); \
else \
echo $(FB_CREATE_SYS); \
fi`
FB_REPORT = `if test -e $(FB_REPORT_WS); then \
echo $(FB_REPORT_WS); \
else \
echo $(FB_REPORT_SYS); \
fi`
%.runtest: %.res ;
%.out: %.feedback
$(FB_REPORT) $< > $@
autopar_%.feedback: %_dir/Deep.data %_dir/Deep.procrep
$(FB_CREATE) -v 0 --implicit-parallelism $< $@
%.realclean:
rm -rf $(@:.realclean=.feedback) \
$(@:.realclean=.out) \
$(@:.realclean=.res) \
$(@:.realclean=.res1) \
$(@:.realclean=.log)