mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-25 14:24:11 +00:00
Estimated hours taken: 9 Provide a more uniform interface to the test directories. Before this change, the tests directory as well as direct descendents had `runtests' scripts to execute the tests. These would run `mmake', which in turn would recursively run `mmake' in any subdirectories. The subdirectories did not have their own `runtests' scripts. This change adds a `runtests' script to those subdirectories that did not have them before. The scripts have the same meaning as they did previously---run all tests in the current directory and below, and return a status of 0 only if all tests pass. The rationale for this change is so that each directory in the tests is treated the same, regardless of whether it is a top-level directory or not. This means, for example, that any test directory can be used as an argument to the `--test-dir' option to tools/bootcheck. This change also links tests/general/accumulator into the automated testing suite. tests/README: Update comments. tests/Mmake.common: Introduce new target dependencies. Targets of the form `foo' depend on the targets `foo_local' and `foo_subdirs'. tests/subdir_runtests: New script to recursively call runtests scripts in subdirectories. Most of the code for this script originally came from tests/runtests. tests/shutdown: tests/startup: Use `realclean_local' as a target instead of `realclean', since the subdirectories will be handled by other runtests scripts. tests/runtests: tests/debugger/runtests: tests/general/runtests: tests/hard_coded/runtests: Use the new script to run tests in the subdirectories, rather than doing a recursive mmake. Make sure that non-zero return values are propagated upwards where appropriate. tests/debugger/declarative/runtests: tests/hard_coded/typeclasses/runtests: tests/hard_coded/sub-modules/runtests: New scripts to handle running tests in the subdirectories. tests/debugger/Mmakefile: tests/general/Mmakefile: tests/hard_coded/Mmakefile: Add `*_subdirs' targets that do a recursive Mmake. Change the existing targets to `*_local' ones. tests/warnings/Mmakefile: Manually add the extra dependencies, since this Mmakefile does not include tests/Mmake.common.
186 lines
4.3 KiB
Plaintext
186 lines
4.3 KiB
Plaintext
#-----------------------------------------------------------------------------#
|
|
|
|
main_target: check
|
|
|
|
include ../Mmake.common
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
PROGS= \
|
|
address_of_builtins \
|
|
agg \
|
|
bidirectional \
|
|
bigtest \
|
|
boyer \
|
|
c_write_string \
|
|
cc_and_non_cc_test \
|
|
cc_nondet_disj \
|
|
cc_multi_bug \
|
|
closure_extension \
|
|
common_type_cast \
|
|
construct \
|
|
curry \
|
|
curry2 \
|
|
cut_test \
|
|
cycles \
|
|
cycles2 \
|
|
deep_copy \
|
|
deep_copy_bug \
|
|
det_in_semidet_cntxt \
|
|
division_test \
|
|
dupcall_types_bug \
|
|
elim_special_pred \
|
|
existential_bound_tvar \
|
|
existential_reordering \
|
|
eqv_type_bug \
|
|
error_func \
|
|
erroneous_liveness \
|
|
expand \
|
|
export_test \
|
|
factt \
|
|
float_map \
|
|
float_reg \
|
|
float_rounding_bug \
|
|
free_free_mode \
|
|
func_and_pred \
|
|
func_ctor_ambig \
|
|
func_test \
|
|
getopt_test \
|
|
ground_dd \
|
|
higher_order_func_test \
|
|
higher_order_syntax \
|
|
higher_order_type_manip \
|
|
ho_func_reg \
|
|
ho_order \
|
|
ho_order2 \
|
|
ho_solns \
|
|
ho_univ_to_type \
|
|
impossible_unify \
|
|
impure_prune \
|
|
integer_test \
|
|
merge_and_remove_dups \
|
|
minint_bug \
|
|
mode_choice \
|
|
name_mangling \
|
|
no_fully_strict \
|
|
no_inline \
|
|
nondet_c \
|
|
nondet_ctrl_vn \
|
|
nullary_ho_func \
|
|
pragma_c_code \
|
|
pragma_inline \
|
|
pragma_import \
|
|
purity \
|
|
qual_adv_test \
|
|
qual_basic_test \
|
|
qual_is_test \
|
|
quantifier \
|
|
quoting_bug_test \
|
|
rational_test \
|
|
relation_test \
|
|
remove_file \
|
|
reorder_di \
|
|
rev_arith \
|
|
reverse_arith \
|
|
rnd \
|
|
rtc_bug \
|
|
shift_test \
|
|
space \
|
|
string_alignment \
|
|
string_alignment_bug \
|
|
string_loop \
|
|
test_imported_no_tag \
|
|
term_io_test \
|
|
tim_qual1 \
|
|
type_spec \
|
|
write \
|
|
write_reg1
|
|
|
|
# we do no pass the following tests
|
|
# var_not_found -- "sorry, not implemented" in polymorphism.m.
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# some tests need to be compiled with particular options
|
|
|
|
MCFLAGS-bigtest = --intermodule-optimization -O3
|
|
MCFLAGS-lp = --intermodule-optimization -O3
|
|
MCFLAGS-boyer = --infer-all
|
|
MCFLAGS-func_test = --infer-all
|
|
MCFLAGS-ho_order = --optimize-higher-order
|
|
MCFLAGS-ho_order2 = --optimize-higher-order
|
|
MCFLAGS-no_fully_strict = --no-fully-strict
|
|
MCFLAGS-nondet_ctrl_vn = --optimize-value-number
|
|
MCFLAGS-rnd = -O6
|
|
MCFLAGS-type_spec = --user-guided-type-specialization
|
|
|
|
# In grade `none' with options `-O1 --opt-space' on kryten
|
|
# (a sparc-sun-solaris2.5 system), mode_choice needs to be linked
|
|
# with `--no-strip', otherwise it gets a seg fault.
|
|
# The test case ../hard_coded/string_test suffers from a similar problem.
|
|
# This is probably a bug in one of the underlying tools (e.g. the Solaris
|
|
# linker) rather than a bug in Mercury, and since it is goes away when you
|
|
# compile with debugging information, it is very difficult to debug.
|
|
# It is much easier to just work around it this way rather than
|
|
# tracking it down.
|
|
MLFLAGS-mode_choice = --no-strip
|
|
|
|
# these tests run out of memory unless we have GC
|
|
GRADEFLAGS-integer_test = --gc conservative
|
|
GRADEFLAGS-integer_test_init = --gc conservative
|
|
GRADEFLAGS-rational_test = --gc conservative
|
|
GRADEFLAGS-rational_test_init = --gc conservative
|
|
|
|
# no_fully_strict is expected to fail (it calls error/1)
|
|
# so we need to ignore the exit status (hence the leading `-')
|
|
no_fully_strict.out: no_fully_strict
|
|
-./no_fully_strict > no_fully_strict.out 2>&1;
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
DEPS= $(PROGS:%=%.dep)
|
|
DEPENDS=$(PROGS:%=%.depend)
|
|
OUTS= $(PROGS:%=%.out)
|
|
RESS= $(PROGS:%=%.res)
|
|
|
|
dep_local: $(DEPS)
|
|
depend_local: $(DEPENDS)
|
|
check_local: $(OUTS) $(RESS)
|
|
all_local: $(PROGS)
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
SUBDIRS = typeclasses sub-modules
|
|
|
|
dep_subdirs:
|
|
for dir in $(SUBDIRS); do \
|
|
(cd $$dir && $(SUBDIR_MMAKE) dep) || exit 1; \
|
|
done
|
|
|
|
depend_subdirs:
|
|
for dir in $(SUBDIRS); do \
|
|
(cd $$dir && $(SUBDIR_MMAKE) depend) || exit 1; \
|
|
done
|
|
|
|
check_subdirs:
|
|
for dir in $(SUBDIRS); do \
|
|
(cd $$dir && $(SUBDIR_MMAKE) check) || exit 1; \
|
|
done
|
|
|
|
all_subdirs:
|
|
for dir in $(SUBDIRS); do \
|
|
(cd $$dir && $(SUBDIR_MMAKE) all) || exit 1; \
|
|
done
|
|
|
|
clean_subdirs:
|
|
for dir in $(SUBDIRS); do \
|
|
(cd $$dir && $(SUBDIR_MMAKE) clean) || exit 1; \
|
|
done
|
|
|
|
realclean_subdirs:
|
|
for dir in $(SUBDIRS); do \
|
|
(cd $$dir && $(SUBDIR_MMAKE) realclean) || exit 1; \
|
|
done
|
|
|
|
#-----------------------------------------------------------------------------#
|