diff --git a/tests/Mmake.common b/tests/Mmake.common index 50a82c1e5..11ae1db66 100644 --- a/tests/Mmake.common +++ b/tests/Mmake.common @@ -338,15 +338,20 @@ start_runtests_local: export tests_dir; \ $(TESTS_DIR)/run_one_test -# XXX The tests cannot be run in parallel because where several test -# cases depend on the same target, the different invocations of mmake -# above may all attempt to create the target at the same time. -# Also, `mmake $$test.realclean' would be run before all users -# of the target are finished with it. +# XXX In some test directories, several test cases depend on the same target, +# so the tests cannot be run in parallel, for two reasons, First, because +# the different invocations of mmake for different tests above may all attempt +# to create the target at the same time, and second, the invocation of +# `mmake $$test.realclean' after a test could be run before other users +# of the shared target are finished with it. +# +# Test directories which have such shared targets should set MAYBE_J1 to -j1. +# Other test directories should set it to the empty string. + TEST_LOGS = $(THIS_DIR_TESTS_TO_RUN:%=%.log) runtests_local: @ \ - mmake -k -j1 $(TEST_LOGS); \ + mmake -k $(MAYBE_J1) $(TEST_LOGS); \ touch DUMMY.log; \ cat *.log > $(ERROR_OUTPUT_FILE); \ rm -f DUMMY.log; \ diff --git a/tests/accumulator/Mmakefile b/tests/accumulator/Mmakefile index b58f00249..21f06b1c7 100644 --- a/tests/accumulator/Mmakefile +++ b/tests/accumulator/Mmakefile @@ -8,38 +8,39 @@ THIS_DIR = accumulator # Any program added here should also be added to the `.cvsignore' file. -ACCUMULATOR_PROGS= \ - base \ - call_in_base \ - chain \ - commutative \ - construct_test \ - deconstruct_test\ - dcg \ - disj \ - func \ - highorder \ - heuristic \ - identity \ - inter \ - ite \ - nonrec \ - out_to_in \ - qsort \ - simple \ - split \ - swap +ACCUMULATOR_PROGS = \ + base \ + call_in_base \ + chain \ + commutative \ + construct_test \ + deconstruct_test \ + dcg \ + disj \ + func \ + highorder \ + heuristic \ + identity \ + inter \ + ite \ + nonrec \ + out_to_in \ + qsort \ + simple \ + split \ + swap # We currently don't do any testing in grade java on this directory. ifneq "$(findstring java,$(GRADE))" "" - PROGS= + PROGS = else - PROGS=$(ACCUMULATOR_PROGS) + PROGS = $(ACCUMULATOR_PROGS) endif -SUBDIRS= +SUBDIRS = TESTS = $(PROGS) -TESTS_DIR=.. +TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/analysis/Mmakefile b/tests/analysis/Mmakefile index 489465f8d..026488a0c 100644 --- a/tests/analysis/Mmakefile +++ b/tests/analysis/Mmakefile @@ -11,9 +11,10 @@ override EXTRA_MCFLAGS := $(patsubst --transitive-%,,$(EXTRA_MCFLAGS)) #-----------------------------------------------------------------------------# -TESTS= +TESTS = SUBDIRS = -TESTS_DIR=.. +TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common #-----------------------------------------------------------------------------# diff --git a/tests/analysis_ctgc/Mmakefile b/tests/analysis_ctgc/Mmakefile index a2e38f6c1..9f636115a 100644 --- a/tests/analysis_ctgc/Mmakefile +++ b/tests/analysis_ctgc/Mmakefile @@ -19,6 +19,7 @@ endif SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = -j1 include $(TESTS_DIR)/Mmake.common reuse_m1.runtest: diff --git a/tests/analysis_excp/Mmakefile b/tests/analysis_excp/Mmakefile index 571bc4b5c..a9d93a2ca 100644 --- a/tests/analysis_excp/Mmakefile +++ b/tests/analysis_excp/Mmakefile @@ -19,6 +19,7 @@ endif SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = -j1 include $(TESTS_DIR)/Mmake.common excp_m1.runtest: diff --git a/tests/analysis_external/Mmakefile b/tests/analysis_external/Mmakefile index 8e4bcd442..468d867f9 100644 --- a/tests/analysis_external/Mmakefile +++ b/tests/analysis_external/Mmakefile @@ -21,6 +21,7 @@ endif SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = -j1 include $(TESTS_DIR)/Mmake.common ext.runtest: diff --git a/tests/analysis_sharing/Mmakefile b/tests/analysis_sharing/Mmakefile index a1ebdc443..f31a959b7 100644 --- a/tests/analysis_sharing/Mmakefile +++ b/tests/analysis_sharing/Mmakefile @@ -19,6 +19,7 @@ endif SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common sharing_m1.runtest: diff --git a/tests/analysis_table/Mmakefile b/tests/analysis_table/Mmakefile index 68e1701b4..a354655bc 100644 --- a/tests/analysis_table/Mmakefile +++ b/tests/analysis_table/Mmakefile @@ -19,6 +19,7 @@ endif SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common table_m1.runtest: diff --git a/tests/analysis_trail/Mmakefile b/tests/analysis_trail/Mmakefile index b9d2dad31..358ed747a 100644 --- a/tests/analysis_trail/Mmakefile +++ b/tests/analysis_trail/Mmakefile @@ -19,6 +19,7 @@ endif SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = -j1 include $(TESTS_DIR)/Mmake.common trail_m1.runtest: diff --git a/tests/analysis_unused_args/Mmakefile b/tests/analysis_unused_args/Mmakefile index 98a641aab..0fc926008 100644 --- a/tests/analysis_unused_args/Mmakefile +++ b/tests/analysis_unused_args/Mmakefile @@ -19,6 +19,7 @@ endif SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = -j1 include $(TESTS_DIR)/Mmake.common ua_m1.runtest: diff --git a/tests/benchmarks/Mmakefile b/tests/benchmarks/Mmakefile index 448d0aad9..fbe448375 100644 --- a/tests/benchmarks/Mmakefile +++ b/tests/benchmarks/Mmakefile @@ -13,7 +13,7 @@ THIS_DIR = benchmarks #-----------------------------------------------------------------------------# -PROGS= \ +PROGS = \ cqueens \ crypt \ deriv \ @@ -26,10 +26,10 @@ PROGS= \ query \ tak -TESTS=$(PROGS) -TESTS = $(sort $(PROGS)) +TESTS = $(PROGS) SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/debugger/Mmakefile b/tests/debugger/Mmakefile index 4a7a21f67..94addd8af 100644 --- a/tests/debugger/Mmakefile +++ b/tests/debugger/Mmakefile @@ -228,6 +228,7 @@ endif SUBDIRS = TESTS = $(sort $(PROGS)) TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # The minimum trace level in .decldebug grades is --trace decl. diff --git a/tests/declarative_debugger/Mmakefile b/tests/declarative_debugger/Mmakefile index 734bf2c27..9e0291e2c 100644 --- a/tests/declarative_debugger/Mmakefile +++ b/tests/declarative_debugger/Mmakefile @@ -6,7 +6,7 @@ THIS_DIR = declarative_debugger #-----------------------------------------------------------------------------# -DECLARATIVE_PROGS= \ +DECLARATIVE_PROGS = \ aadebug \ all_trusted \ app \ @@ -169,6 +169,10 @@ endif SUBDIRS= TESTS=$(PROGS) TESTS_DIR=.. +# Most test cases share library_forwarding.m. We could allow the tests +# to be done in parallel if we made a separate copy of that module +# for each test case that needs it. +MAYBE_J1 = -j1 include $(TESTS_DIR)/Mmake.common MCFLAGS += --trace decl diff --git a/tests/dppd/Mmakefile b/tests/dppd/Mmakefile index 6ff90334e..a1dab8ffb 100644 --- a/tests/dppd/Mmakefile +++ b/tests/dppd/Mmakefile @@ -17,6 +17,7 @@ else endif TESTS = $(sort $(PROGS)) +MAYBE_J1 = -j1 include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/exceptions/Mmakefile b/tests/exceptions/Mmakefile index 9eca24cba..45b9c2d9b 100644 --- a/tests/exceptions/Mmakefile +++ b/tests/exceptions/Mmakefile @@ -43,8 +43,9 @@ else endif TESTS = $(PROGS) -SUBDIRS= -TESTS_DIR=.. +SUBDIRS = +TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/feedback/Mmakefile b/tests/feedback/Mmakefile index 3daed429d..d266caa62 100644 --- a/tests/feedback/Mmakefile +++ b/tests/feedback/Mmakefile @@ -14,7 +14,8 @@ REPORTS=$(patsubst %,autopar_%,$(AUTOPAR_REPORTS)) TESTS = $(patsubst %,%-nodepend,$(sort $(REPORTS))) TESTS_DIR = .. -SUBDIRS= +SUBDIRS = +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Try to use the feedback tools in this workspace if available; diff --git a/tests/general/Mmakefile b/tests/general/Mmakefile index c88b4a6e6..579d5d5fe 100644 --- a/tests/general/Mmakefile +++ b/tests/general/Mmakefile @@ -8,79 +8,79 @@ THIS_DIR = general # Any program added here should also be added to the `.cvsignore' file. -ORDINARY_PROGS= \ - arithmetic \ - array_binsearch \ - array_test \ - base_string_to_int_test \ - base_string_to_integer \ - commit_bug \ - commit_bug_2 \ - complex_failure \ - det_complicated_unify \ - determinism_inlining \ - disj_disj \ - do_while \ - double_error \ - double_error2 \ - duplicate_label \ - environment \ - fail_detism \ - float_roundtrip \ - float_test \ - frameopt_mkframe_bug \ - hello_again \ - higher_order \ - hlc_name_mangling \ - ho_spec_branch_bug \ - intermod_type \ - interpreter \ - io_foldl \ - io_regression \ - liveness \ - liveness2 \ - map_equal \ - mode_inf \ - mode_inf_bug \ - mode_inference_reorder \ - mu \ - nasty_nondet \ - nondet_disj \ - nondet_ite \ - nondet_ite_2 \ - nondet_ite_3 \ - nondet_ite_4 \ - nondetlive \ - parse_list \ - partition \ - petdr1 \ - prune_switch \ - semi_fail_in_non_ite \ - semidet_lambda \ - read_line_as_string \ - semidet_map \ - set_test \ - state_vars_tests \ - state_vars_typeclasses \ - string_foldl_substring \ - string_foldr_substring \ - string_format_special_floats \ - string_format_test \ - string_format_test_2 \ - string_format_test_3 \ - string_replace \ - string_test \ - string_test_2 \ - string_to_float \ - test_parsing_utils \ - test_string_to_int_overflow \ - test_univ \ - unreachable \ - unsafe_uniqueness +ORDINARY_PROGS = \ + arithmetic \ + array_binsearch \ + array_test \ + base_string_to_int_test \ + base_string_to_integer \ + commit_bug \ + commit_bug_2 \ + complex_failure \ + det_complicated_unify \ + determinism_inlining \ + disj_disj \ + do_while \ + double_error \ + double_error2 \ + duplicate_label \ + environment \ + fail_detism \ + float_roundtrip \ + float_test \ + frameopt_mkframe_bug \ + hello_again \ + higher_order \ + hlc_name_mangling \ + ho_spec_branch_bug \ + intermod_type \ + interpreter \ + io_foldl \ + io_regression \ + liveness \ + liveness2 \ + map_equal \ + mode_inf \ + mode_inf_bug \ + mode_inference_reorder \ + mu \ + nasty_nondet \ + nondet_disj \ + nondet_ite \ + nondet_ite_2 \ + nondet_ite_3 \ + nondet_ite_4 \ + nondetlive \ + parse_list \ + partition \ + petdr1 \ + prune_switch \ + read_line_as_string \ + semi_fail_in_non_ite \ + semidet_lambda \ + semidet_map \ + set_test \ + state_vars_tests \ + state_vars_typeclasses \ + string_foldl_substring \ + string_foldr_substring \ + string_format_special_floats \ + string_format_test \ + string_format_test_2 \ + string_format_test_3 \ + string_replace \ + string_test \ + string_test_2 \ + string_to_float \ + test_parsing_utils \ + test_string_to_int_overflow \ + test_univ \ + unreachable \ + unsafe_uniqueness EXCEPTION_PROGS = \ - map_corresponding \ - unused_arg_determinism + map_corresponding \ + unused_arg_determinism # XXX Java testing is disabled for this directory since most tests # currently fail. The reason for this is that they depend too @@ -113,6 +113,7 @@ NOT_WORKING = dnf state_var_trace SUBDIRS = TESTS = $(sort $(PROGS)) TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/grade_subdirs/Mmakefile b/tests/grade_subdirs/Mmakefile index 4ce6ea6d3..ce4819919 100644 --- a/tests/grade_subdirs/Mmakefile +++ b/tests/grade_subdirs/Mmakefile @@ -7,12 +7,12 @@ THIS_DIR = grade_subdirs ifndef WORKSPACE - PROGS=\ + PROGS = \ hello else # We can only use a workspace if it was built with # `--use-grade-subdirs', which in general it won't be. - PROGS= + PROGS = endif # `--use-grade-subdirs' doesn't work with Mmake. @@ -21,6 +21,7 @@ MMAKE_USE_MMC_MAKE=yes TESTS = $(sort $(PROGS)) SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/hard_coded/Mmakefile b/tests/hard_coded/Mmakefile index 9ceb1fb4a..62edbfad1 100644 --- a/tests/hard_coded/Mmakefile +++ b/tests/hard_coded/Mmakefile @@ -6,7 +6,7 @@ THIS_DIR = hard_coded #-----------------------------------------------------------------------------# -ORDINARY_PROGS= \ +ORDINARY_PROGS = \ abstract_eqv \ address_of_builtins \ agg \ @@ -375,7 +375,7 @@ endif # JAVA_PASS_PROGS lists those tests which will succeed in grade Java. -JAVA_PASS_PROGS= \ +JAVA_PASS_PROGS = \ address_of_builtins \ brace \ c_write_string \ @@ -752,6 +752,7 @@ PROGS = $(ORDINARY_PROGS) $(PROF_PROGS) $(BROKEN_FOR_LCC_PROGS) \ TESTS = $(sort $(PROGS)) SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/invalid/Mmakefile b/tests/invalid/Mmakefile index 613474f20..a3aa0de89 100644 --- a/tests/invalid/Mmakefile +++ b/tests/invalid/Mmakefile @@ -361,10 +361,11 @@ SINGLEMODULE_PROGS = $(SINGLEMODULE) \ #-----------------------------------------------------------------------------# -PROGS= $(SINGLEMODULE_PROGS) $(MULTIMODULE_PROGS) +PROGS = $(SINGLEMODULE_PROGS) $(MULTIMODULE_PROGS) TESTS = $(sort $(MULTIMODULE_PROGS) $(SINGLEMODULE_PROGS:%=%-nodepend)) SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/invalid_purity/Mmakefile b/tests/invalid_purity/Mmakefile index cb4626366..aeb9353f9 100644 --- a/tests/invalid_purity/Mmakefile +++ b/tests/invalid_purity/Mmakefile @@ -26,6 +26,7 @@ PROGS= \ TESTS = $(PROGS) SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # These tests all get spurious failures with intermodule optimization, diff --git a/tests/misc_tests/Mmakefile b/tests/misc_tests/Mmakefile index a5c7f2a64..7379d034d 100644 --- a/tests/misc_tests/Mmakefile +++ b/tests/misc_tests/Mmakefile @@ -6,11 +6,14 @@ THIS_DIR = misc_tests SUBDIRS = PROGS = -TESTS = mdemangle_test-nodepend pretty_print_test-nodepend +TESTS = \ + mdemangle_test-nodepend \ + pretty_print_test-nodepend # XXX we do not yet pass mdemangle_test_hl # (util/mdemangle.c doesn't correctly demangle internal labels) # TESTS += mdemangle_test_hl-nodepend -TESTS_DIR=.. +TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/mmc_make/Mmakefile b/tests/mmc_make/Mmakefile index dbb188834..ab56a832b 100644 --- a/tests/mmc_make/Mmakefile +++ b/tests/mmc_make/Mmakefile @@ -11,12 +11,12 @@ THIS_DIR = mmc_make MMAKE_USE_MMC_MAKE=yes PROGS = \ - complex_test \ - hello \ - include_file \ - include_file2 \ - linkage_test \ - rebuild + complex_test \ + hello \ + include_file \ + include_file2 \ + linkage_test \ + rebuild # These tests only work if the workspace was compiled with `--use-subdirs'. ifneq ($(origin WORKSPACE),undefined) @@ -28,6 +28,7 @@ endif SUBDIRS = TESTS = $(sort $(PROGS)) TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common %.runtest: %.res ; diff --git a/tests/par_conj/Mmakefile b/tests/par_conj/Mmakefile index b97d16dad..0a3384cb4 100644 --- a/tests/par_conj/Mmakefile +++ b/tests/par_conj/Mmakefile @@ -7,7 +7,7 @@ THIS_DIR = par_conj #-----------------------------------------------------------------------------# # please keep these lists sorted -DEP_PAR_CONJ_PROGS= \ +DEP_PAR_CONJ_PROGS = \ bug_130_unreachable \ bug_130_should_push_signal \ consume_in_some_branches \ @@ -125,6 +125,7 @@ OBJS = $(OBJ_PROGS:%=$(TARGET_OBJ_SUBDIR)%.$(TARGET_OBJ_EXT)) \ TESTS = $(sort $(PROGS)) SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/purity/Mmakefile b/tests/purity/Mmakefile index a3184fd1a..e265c5a9b 100644 --- a/tests/purity/Mmakefile +++ b/tests/purity/Mmakefile @@ -23,8 +23,9 @@ else endif TESTS = $(PROGS) -SUBDIRS= -TESTS_DIR=.. +SUBDIRS = +TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/recompilation/Mmakefile b/tests/recompilation/Mmakefile index 58d261186..c14663f11 100644 --- a/tests/recompilation/Mmakefile +++ b/tests/recompilation/Mmakefile @@ -44,12 +44,13 @@ TESTS_SHOULD_FAIL = \ type_qual_re \ with_type_re -PROGS= $(TESTS_SHOULD_SUCCEED) $(NO_PARALLEL_MAKE_TESTS) \ +PROGS = $(TESTS_SHOULD_SUCCEED) $(NO_PARALLEL_MAKE_TESTS) \ $(TESTS_SHOULD_FAIL) -TESTS= $(sort $(PROGS:%=%-nodepend)) +TESTS = $(sort $(PROGS:%=%-nodepend)) SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = -j1 include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/stm/Mmakefile b/tests/stm/Mmakefile index 976c8c471..017511cd6 100644 --- a/tests/stm/Mmakefile +++ b/tests/stm/Mmakefile @@ -7,22 +7,21 @@ THIS_DIR = stm #-----------------------------------------------------------------------------# # please keep these lists sorted -VALID_PROGS = \ +VALID_PROGS = \ basic \ basic2 \ - exception_propogate \ + exception_propogate \ nested \ - nested_or_else \ - atomic_or_else \ - atomic_or_else2 \ + nested_or_else \ + atomic_or_else \ + atomic_or_else2 \ atomic_conj \ atomic_ite \ atomic_mvar \ - atomic_scope \ - #demo \ - par-asm_test7 \ - par-asm_test8 \ - par-asm_test9 \ + atomic_scope \ + par-asm_test7 \ + par-asm_test8 \ + par-asm_test9 \ par_test10 \ par_test8 \ par_test9 \ @@ -83,6 +82,7 @@ OBJS = $(OBJ_PROGS:%=$(TARGET_OBJ_SUBDIR)%.$(TARGET_OBJ_EXT)) \ TESTS = $(sort $(PROGS)) SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = -j1 include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they @@ -104,7 +104,7 @@ ifneq ($(MMAKE_USE_MMC_MAKE),yes) else % XXX: with `mmake --use-mmc-make' the ".DEFAULT:" rule seems to take -% precedence over "%.err: %.m" rules. +% precedence over "%.err: %.m" rules. % XXX: the reason we run the $(MCM) command twice is to avoid % doubled up error messages, once while making interface files, % then the module proper. The second time the command is run diff --git a/tests/string_format/Mmakefile b/tests/string_format/Mmakefile index 9253ba1af..a6a739bc1 100644 --- a/tests/string_format/Mmakefile +++ b/tests/string_format/Mmakefile @@ -8,31 +8,31 @@ THIS_DIR = string_format # Any program added here should also be added to the `.cvsignore' file. -STRING_FORMAT_PROGS= \ - string_format_c \ - string_format_d \ - string_format_e \ - string_format_f \ - string_format_g \ - string_format_o \ - string_format_s \ - string_format_u \ - string_format_x +STRING_FORMAT_PROGS = \ + string_format_c \ + string_format_d \ + string_format_e \ + string_format_f \ + string_format_g \ + string_format_o \ + string_format_s \ + string_format_u \ + string_format_x - # The tests don't work in the *.agc grades, because I think they - # take too long to finsih and the CPU time limit is breached. +# The tests don't work in the *.agc grades, because I think they +# take too long to finish and the CPU time limit is breached. ifneq "$(findstring .agc,$(GRADE))" "" PROGS0= else PROGS0=$(STRING_FORMAT_PROGS) endif - # On solaris 5.{7,8} string_format_o fails because of a buggy - # sprintf implementation. +# On solaris 5.{7,8} string_format_o fails because of a buggy +# sprintf implementation. SOLARIS_FAILURES=string_format_o - # On Dec OSF 5.1 the floating point tests fail because - # the denormal floats aren't being printed correctly. +# On Dec OSF 5.1 the floating point tests fail because +# the denormal floats aren't being printed correctly. OSF1_FAILURES=string_format_e string_format_f string_format_g UNAME:=$(shell uname -r -s) @@ -49,6 +49,7 @@ endif SUBDIRS = TESTS=$(PROGS) TESTS_DIR=.. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/structure_reuse/Mmakefile b/tests/structure_reuse/Mmakefile index 1527c9334..e57eae358 100644 --- a/tests/structure_reuse/Mmakefile +++ b/tests/structure_reuse/Mmakefile @@ -6,7 +6,7 @@ THIS_DIR = structure_reuse # Any program added here should also be added to the `.cvsignore' file. -STRUCTURE_REUSE_PROGS = \ +STRUCTURE_REUSE_PROGS = \ if_then_else \ internal_alias \ interpret @@ -21,6 +21,7 @@ endif TESTS = $(PROGS) SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/submodules/Mmakefile b/tests/submodules/Mmakefile index 510ac9ef3..d0d8e111f 100644 --- a/tests/submodules/Mmakefile +++ b/tests/submodules/Mmakefile @@ -11,12 +11,7 @@ THIS_DIR = submodules #-----------------------------------------------------------------------------# -# -# Note: currently these test cases do not reliabily pass -# if you use parallel make. -# - -SUB_MODULE_PROGS= \ +SUB_MODULE_PROGS = \ accessibility \ accessibility2 \ class \ @@ -47,7 +42,11 @@ PROGS=$(SUB_MODULE_PROGS) $(SOLVER_PROGS) TESTS = $(PROGS) TESTS_DIR=.. -SUBDIRS= +SUBDIRS = +# Note: currently these test cases do not reliably pass +# if you use parallel make. +# XXX should try again +MAYBE_J1 = -j1 include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/submodules/accessibility2.m b/tests/submodules/accessibility2.m index e3250c7ac..b4492f19f 100644 --- a/tests/submodules/accessibility2.m +++ b/tests/submodules/accessibility2.m @@ -12,8 +12,8 @@ :- implementation. -:- import_module sub_a.sub1. -:- import_module sub_a. +:- import_module sub2_a.sub1. +:- import_module sub2_a. main --> io__write_string("Hello.\n"). diff --git a/tests/submodules/sub2_a.m b/tests/submodules/sub2_a.m new file mode 100644 index 000000000..9660d2130 --- /dev/null +++ b/tests/submodules/sub2_a.m @@ -0,0 +1,33 @@ +%---------------------------------------------------------------------------% +% vim: ts=4 sw=4 et ft=mercury +%---------------------------------------------------------------------------% + +:- module sub2_a. + +:- interface. + +:- type t1. + +:- module sub1. + +:- interface. + +:- type t2. + +:- end_module sub1. + +:- implementation. + +:- module sub1. + +:- implementation. + +:- import_module int. + +:- type t2 == int. + +:- end_module sub1. + +:- import_module float. + +:- type t1 == float. diff --git a/tests/tabling/Mmakefile b/tests/tabling/Mmakefile index c2b812211..4ac48f6b6 100644 --- a/tests/tabling/Mmakefile +++ b/tests/tabling/Mmakefile @@ -162,6 +162,7 @@ endif TESTS = $(sort $(PROGS)) SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/term/Mmakefile b/tests/term/Mmakefile index 18464b412..619931fd9 100644 --- a/tests/term/Mmakefile +++ b/tests/term/Mmakefile @@ -8,9 +8,9 @@ THIS_DIR = term ifeq ($(MMAKE_USE_MMC_MAKE),yes) # `mmc --make' doesn't know how to create `.trans_opt' files. -TERM_PROGS= +TERM_PROGS = else -TERM_PROGS= \ +TERM_PROGS = \ ack \ append \ arit_exp \ @@ -82,13 +82,14 @@ endif # $(MMAKE_USE_MMC_MAKE) == no # can be found by `mmc --make'. include Mercury.options -PROGS=$(TERM_PROGS) +PROGS = $(TERM_PROGS) #-----------------------------------------------------------------------------# TESTS = $(sort $(PROGS)) SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common %.runtest: %.trans_opt_res ; @@ -100,11 +101,10 @@ MCOPTFLAGS = --no-inlining --no-optimize-unused-args --no-deforestation \ --no-optimize-higher-order MCTRANSOPTFLAGS = $(MCTERMFLAGS) $(MCOPTFLAGS) - # if EXTRA_MCFLAGS=-O5 then --no-inlining must occur after the - # -O5 to turn inlining off. - # The following ensures that MCTRANSOPTFLAGS overrides any - # thing set by EXTRA_MCFLAGS, by placing them later in the - # argument list. +# if EXTRA_MCFLAGS=-O5 then --no-inlining must occur after the -O5 +# to turn inlining off. +# The following ensures that MCTRANSOPTFLAGS overrides anything +# set by EXTRA_MCFLAGS, by placing them later in the argument list. ALL_MCTOIFLAGS+=$(MCTRANSOPTFLAGS) %.trans_opt_res: %.trans_opt_exp $(trans_opts_subdir)%.trans_opt diff --git a/tests/trailing/Mmakefile b/tests/trailing/Mmakefile index f9aa488cf..e346e696c 100644 --- a/tests/trailing/Mmakefile +++ b/tests/trailing/Mmakefile @@ -25,6 +25,7 @@ PROGS = $(TRAIL_PROGS) TESTS = $(sort $(PROGS)) SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/typeclasses/Mmakefile b/tests/typeclasses/Mmakefile index 94c3eaf51..2c4260192 100644 --- a/tests/typeclasses/Mmakefile +++ b/tests/typeclasses/Mmakefile @@ -6,7 +6,7 @@ THIS_DIR = typeclasses #-----------------------------------------------------------------------------# -TYPECLASSES_PROGS= \ +TYPECLASSES_PROGS = \ arbitrary_constraint_class \ arbitrary_constraint_pred_2 \ arbitrary_constraint_pred_1 \ @@ -80,7 +80,7 @@ TYPECLASSES_PROGS= \ # XXX We currently do only limited testing in grade java on this directory. -JAVA_TYPECLASSES_PROGS= \ +JAVA_TYPECLASSES_PROGS = \ ground_constraint \ implied_instance \ implied_instance_poly \ @@ -105,14 +105,15 @@ JAVA_TYPECLASSES_PROGS= \ # instance_unconstrained_tvar_dup ifneq "$(findstring java,$(GRADE))" "" - PROGS=$(JAVA_TYPECLASSES_PROGS) + PROGS = $(JAVA_TYPECLASSES_PROGS) else - PROGS=$(TYPECLASSES_PROGS) + PROGS = $(TYPECLASSES_PROGS) endif TESTS = $(PROGS) -SUBDIRS= -TESTS_DIR=.. +SUBDIRS = +TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they diff --git a/tests/valid/Mmakefile b/tests/valid/Mmakefile index d4e531884..c0ceca7af 100644 --- a/tests/valid/Mmakefile +++ b/tests/valid/Mmakefile @@ -490,6 +490,7 @@ OBJS = $(OBJ_PROGS:%=$(TARGET_OBJ_SUBDIR)%.$(TARGET_OBJ_EXT)) \ TESTS = $(sort $(PROGS)) SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # When compiling using the installed libraries, setting GRADEFLAGS diff --git a/tests/valid/ambig_high_level.m b/tests/valid/ambig_high_level.m index 645652693..38dd03883 100644 --- a/tests/valid/ambig_high_level.m +++ b/tests/valid/ambig_high_level.m @@ -14,7 +14,7 @@ % :- import_module ambig_confuse1. % :- import_module ambig_confuse2. -:- import_module ambig_types. +:- import_module ambig_types_high_level. main(!IO) :- X = foo, diff --git a/tests/valid/ambig_types_high_level.m b/tests/valid/ambig_types_high_level.m new file mode 100644 index 000000000..c45e64fa7 --- /dev/null +++ b/tests/valid/ambig_types_high_level.m @@ -0,0 +1,15 @@ +%---------------------------------------------------------------------------% +% vim: ts=4 sw=4 et ft=mercury +%---------------------------------------------------------------------------% + +:- module ambig_types_high_level. + +:- interface. + +:- type a ---> foo ; bar. +:- type b ---> bar ; baz. +:- type c ---> baz ; foo. + +:- implementation. + +:- end_module ambig_types_high_level. diff --git a/tests/warnings/Mmakefile b/tests/warnings/Mmakefile index 36a1266c0..fae34a7e5 100644 --- a/tests/warnings/Mmakefile +++ b/tests/warnings/Mmakefile @@ -6,7 +6,7 @@ THIS_DIR = warnings #-----------------------------------------------------------------------------# -COMPILE_PROGS= \ +COMPILE_PROGS = \ arg_order_rearrangment \ foreign_term_invalid \ non_term_user_special \ @@ -14,10 +14,10 @@ COMPILE_PROGS= \ term_indirect_warning \ warn_dead_procs -ERRORCHECK_PROGS= \ +ERRORCHECK_PROGS = \ ambiguous_overloading \ bug257 \ - bug311 \ + bug311 \ det_infer_warning \ double_underscore \ duplicate_call \ @@ -60,6 +60,7 @@ PROGS=$(COMPILE_PROGS) $(ERRORCHECK_PROGS) up_to_date TESTS = $(sort $(PROGS)) SUBDIRS = TESTS_DIR = .. +MAYBE_J1 = include $(TESTS_DIR)/Mmake.common # Module-specific options should go in Mercury.options so they @@ -93,24 +94,24 @@ up_to_date.runtest: %.res_error: %.exp %.err -rm -f $@ diff $(DIFF_OPTS) $*.exp $*.err > $@ || \ - { [ -f $*.exp2 ] && \ - diff $(DIFF_OPTS) $*.exp2 $*.err > $@; } || \ - { [ -f $*.exp3 ] && \ - diff $(DIFF_OPTS) $*.exp3 $*.err > $@; } || \ - { [ -f $*.exp4 ] && \ - diff $(DIFF_OPTS) $*.exp4 $*.err > $@; } || \ - { cat $*.err; cat $@; exit 1; } + { [ -f $*.exp2 ] && \ + diff $(DIFF_OPTS) $*.exp2 $*.err > $@; } || \ + { [ -f $*.exp3 ] && \ + diff $(DIFF_OPTS) $*.exp3 $*.err > $@; } || \ + { [ -f $*.exp4 ] && \ + diff $(DIFF_OPTS) $*.exp4 $*.err > $@; } || \ + { cat $*.err; cat $@; exit 1; } %.res_compile: %.exp %.c -rm -f $@ diff $(DIFF_OPTS) $*.exp $*.err > $@ || \ - { [ -f $*.exp2 ] && \ - diff $(DIFF_OPTS) $*.exp2 $*.err > $@; } || \ - { [ -f $*.exp3 ] && \ - diff $(DIFF_OPTS) $*.exp3 $*.err > $@; } || \ - { [ -f $*.exp4 ] && \ - diff $(DIFF_OPTS) $*.exp4 $*.err > $@; } || \ - { cat $*.err; cat $@; exit 1; } + { [ -f $*.exp2 ] && \ + diff $(DIFF_OPTS) $*.exp2 $*.err > $@; } || \ + { [ -f $*.exp3 ] && \ + diff $(DIFF_OPTS) $*.exp3 $*.err > $@; } || \ + { [ -f $*.exp4 ] && \ + diff $(DIFF_OPTS) $*.exp4 $*.err > $@; } || \ + { cat $*.err; cat $@; exit 1; } ifeq ($(MMAKE_USE_MMC_MAKE),yes) %.c: %.m diff --git a/tests/warnings/unused_interface_import3.m b/tests/warnings/unused_interface_import3.m index ced79f8bc..2348d38cb 100644 --- a/tests/warnings/unused_interface_import3.m +++ b/tests/warnings/unused_interface_import3.m @@ -1,9 +1,8 @@ %---------------------------------------------------------------------------% % vim: ts=4 sw=4 et ft=mercury %---------------------------------------------------------------------------% -% + :- module unused_interface_import3. :- interface. :- typeclass tc2(T) where []. -