Files
mercury/tests/valid/Mmake.valid.common
Julien Fischer 0c38668e2b Avoid running some tests in incompatible grades.
tests/valid/Mmake.valid.common:
     Don't attempt to run the bug50 and bug50_full test cases
     in non-LLDS grades.
2016-02-14 03:20:31 +11:00

208 lines
6.2 KiB
Makefile

#-----------------------------------------------------------------------------#
# vim: ts=8 sw=8 noexpandtab ft=make
#-----------------------------------------------------------------------------#
#
# This file is included in the Mmakefile of both $(TESTS_DIR)/valid
# and $(TESTS_DIR)/valid_seq. Both those directories contain test cases
# for which we check only that compilation succeeds, and don't test
# what its result is. The difference is that in the valid directory,
# each test file is self-contained and may be compiled in parallel,
# while the test cases valid_seq each consist of more than one module
# (some separate, some nested), and thus must be compiled sequentially,
# without parallelism.
#
# The Mmakefiles in both directories should define the following make variables
# beyond those required by $(TESTS_DIR)/Mmake.common.
#
# AGC_PROGS:
# The test cases testing the accurate gc system.
# TRAIL_PROGS:
# The test cases that only work in trailing grades.
# TYPECLASS_PROGS:
# The test cases testing the handling of typeclasses.
# NO_SPECIAL_PREDS_PROGS:
# The test cases testing the handling of --no-special-preds.
# C_PROGS:
# The test cases for which we should only produce a `.c' file.
# C_INTERFACE_PROGS:
# The test cases that test the operation of the foreign language interface
# with C.
# SOLVER_PROGS:
# The test cases that test the handling of solver type variables.
# DEEP_PROF_CAPABLE_PROGS:
# The test cases that test compilation with deep profiling enabled.
# LLDS_PROGS:
# The test cases that require debugging, which hasn't been implemented
# for the MLDS backend.
# TABLE_PROGS:
# The test cases that only work in grades that support tabling.
# PAR_CONJ_PROGS:
# The test cases that only work in grades that support parallel conjunction.
# CTGC_PROGS:
# The test cases that only work in grades that support compile-time
# garbage collection. Debugging is incompatible with ctgc.
# RESERVE_TAG_PROGS::
# The test cases that require num_tag_bits >= 1.
# CONSTRAINT_TYPECHECK_PROGS::
# Tests that use constraint based type checking.
# XXX These are never enabled.
# NON_DECLDEBUG_PROGS::
# Test that do not work in .decldebug grades
# OTHER_PROGS:
# All the other test cases.
# The agc.* tests don't work in --high-level-code grades,
# except hl*.agc*, because they require grade-specific header
# files to be installed.
ifeq "$(findstring hl,$(GRADE))$(findstring .agc,$(GRADE))" "hl"
PROGS0 = $(TYPECLASS_PROGS) $(OTHER_PROGS)
else
# The agc.* tests don't work in the java, csharp or erlang grades.
# The agc.* tests also don't work in minimal model grades,
# because the collector doesn't scan the copied areas of the stacks.
ifneq "$(filter java% csharp% erlang%,$(GRADE))$(findstring mm,$(GRADE))" ""
PROGS0 = $(TYPECLASS_PROGS) $(OTHER_PROGS)
else
PROGS0 = $(AGC_PROGS) $(TYPECLASS_PROGS) $(OTHER_PROGS)
endif
endif
# Base grades `jump' and `fast' cannot be used with `--no-special-preds'.
ifneq "$(findstring asm_,$(GRADE))" ""
PROGS1 = $(NO_SPECIAL_PREDS_PROGS) $(PROGS0)
else
ifneq "$(findstring jump,$(GRADE))" ""
PROGS1 = $(PROGS0)
else
ifneq "$(findstring fast,$(GRADE))" ""
PROGS1 = $(PROGS0)
else
PROGS1 = $(NO_SPECIAL_PREDS_PROGS) $(PROGS0)
endif
endif
endif
ifneq "$(findstring mm,$(GRADE))" ""
PROGS2 = $(PROGS1)
else
PROGS2 = $(PROGS1) $(TRAIL_PROGS)
endif
ifneq "$(filter java% csharp% erlang%,$(GRADE))$(findstring profdeep,$(GRADE))" ""
PROGS3 = $(PROGS2)
else
PROGS3 = $(PROGS2) $(TABLE_PROGS)
endif
ifeq "$(filter hl% java% csharp% erlang%,$(GRADE))" ""
PROGS4 = $(PROGS3) $(C_INTERFACE_PROGS) $(SOLVER_PROGS) \
$(DEEP_PROF_CAPABLE_PROGS) $(LLDS_PROGS)
else
PROGS4 = $(PROGS3)
endif
ifneq "$(findstring decldebug,$(GRADE))" ""
PROGS5 = $(PROGS4)
else
PROGS5 = $(PROGS4) $(PAR_CONJ_PROGS)
endif
ifeq "$(findstring debug,$(GRADE))" ""
PROGS6 = $(PROGS5) $(CTGC_PROGS)
else
PROGS6 = $(PROGS5)
endif
ifeq "$(filter hl% java% csharp% erlang%,$(GRADE))$(findstring decldebug,$(GRADE))" ""
PROGS7 = $(PROGS6) $(NON_DECLDEBUG_PROGS)
else
PROGS7 = $(PROGS6)
endif
ifeq "$(filter java% csharp% erlang%,$(GRADE))" ""
OBJ_PROGS = $(PROGS7) $(RESERVE_TAG_PROGS)
else
OBJ_PROGS = $(PROGS7)
endif
ifneq "$(findstring tsw,$(GRADE))$(findstring tsc,$(GRADE))" ""
PROGS = $(OBJ_PROGS) $(C_PROGS)
else
PROGS = $(OBJ_PROGS) $(C_PROGS)
endif
# `mmc --make' doesn't expect subdirectories to appear in targets.
ifeq ($(MMAKE_USE_MMC_MAKE),yes)
OS_SUBDIR =
DLLS_SUBDIR =
CLASSES_SUBDIR =
else
OS_SUBDIR = $(os_subdir)
DLLS_SUBDIR = $(dlls_subdir)
CLASSES_SUBDIR = $(classes_subdir)
endif
ifeq ($(findstring csharp,$(GRADE)),csharp)
# XXX we should produce DLLs but currently that invokes the IL backend
TARGET_OBJ_EXT = cs
TARGET_OBJ_SUBDIR = $(DLLS_SUBDIR)
else
ifeq ($(findstring erlang,$(GRADE)),erlang)
TARGET_OBJ_EXT = beam
# Erlang backend currently requires `mmc --make'.
TARGET_OBJ_SUBDIR =
else
ifeq ($(findstring java,$(GRADE)),java)
TARGET_OBJ_EXT = class
TARGET_OBJ_SUBDIR = $(CLASSES_SUBDIR)
else
TARGET_OBJ_EXT = $(O)
TARGET_OBJ_SUBDIR = $(OS_SUBDIR)
endif
endif
endif
OBJS = $(OBJ_PROGS:%=$(TARGET_OBJ_SUBDIR)%.$(TARGET_OBJ_EXT))
#-----------------------------------------------------------------------------#
# When compiling using the installed libraries, setting GRADEFLAGS
# may cause mgnuc to look for the `.mih' files for a non-installed grade.
# test_mercury runs the tests using the installed libraries, so GRADEFLAGS
# won't be set, but test_mercury runs the tests in at least one `.tr' grade
# on all machines, so it isn't a problem.
ifneq ($(origin WORKSPACE),undefined)
GRADEFLAGS_TRAIL = --use-trail
else
GRADEFLAGS_TRAIL =
endif
# Make sure GRADEFLAGS_TRAIL is passed to `mmc --make'.
export GRADEFLAGS_TRAIL
TESTS = $(sort $(PROGS))
include $(TESTS_DIR)/Mmake.common
# Module-specific options should go in Mercury.options so they can be found
# by `mmc --make'.
include Mercury.options
$(OBJ_PROGS:%=%.runtest): %.runtest: %.$(TARGET_OBJ_EXT) ;
$(C_PROGS:%=%.runtest): %.runtest: %.c ;
#-----------------------------------------------------------------------------#
objs: $(OBJS)
printtests:
@echo $(PROGS)
printobjs:
@echo $(OBJS)
clean_local: clean_valid
clean_valid:
rm -f *.err *.h
#-----------------------------------------------------------------------------#