[m-rev.] for review: Avoid tests/invalid failures with intermodule optimisation.

Julien Fischer jfischer at opturion.com
Tue Nov 10 13:04:58 AEDT 2020


On Mon, 9 Nov 2020, Peter Wang wrote:

> tests/invalid/Mmakefile:
>    For modules for which the compiler may emit errors while making
>    their .opt files, redirect the errors to a .err file and ignore the
>    exit status. The .err file will then be compared to .err_exp* files.
>
> diff --git a/tests/invalid/Mmakefile b/tests/invalid/Mmakefile
> index 976bc876d..209f42290 100644
> --- a/tests/invalid/Mmakefile
> +++ b/tests/invalid/Mmakefile
> @@ -562,6 +562,30 @@ require_tailrec_1.err require_tailrec_2.err require_tailrec_3.err foreign_includ
> 	else true; \
> 	fi
> 
> +# For the following modules, error messages may be be produced while making a
> +# `.opt' file. Add specific rules to capture those errors into a `.err' file,
> +# and ignore the exit status.
> +ifeq "$(filter --intermod%,$(EXTRA_MCFLAGS))" ""
> +REDIRECT_OPT_ERROR_MODULES =
> +else
> +REDIRECT_OPT_ERROR_MODULES = \
> +	abstract_eqv \
> +	bad_type_class_constraint_intermodule \
> +	bad_type_class_constraint_intermodule_2 \
> +	bug214 \
> +	bug521 \
> +	bug521_sub \
> +	int_impl_imports \
> +	test_feature_set
> +endif
> +
> +define OVERRIDE_OPT_RULE
> +$$(optdates_subdir)$(1).optdate $(1).err : $(1).m
> +	$$(MCOI) $$(ALL_GRADEFLAGS) $$(ALL_MCOIFLAGS) $$(*F) $$(ERR_REDIRECT) || true
> +endef
> +
> +$(foreach module,$(REDIRECT_OPT_ERROR_MODULES),$(eval $(call OVERRIDE_OPT_RULE,$(module))))

That's fine.

Julien.


More information about the reviews mailing list