[m-dev.] cvs diff: bug fixes for runtests

Fergus Henderson fjh at cs.mu.oz.au
Fri Mar 14 18:14:06 AEDT 1997


Tyson Richard DOWD, you wrote:
> 
> Fix two bugs in the scripts for running tests.
> 
> tests/handle_options:
> 	Pass MCFLAGS and MGNUCFLAGS, not EXTRA_CFLAGS and EXTRA_MCFLAGS
> 	to mmake. It appears previously these options were just not
> 	used, which means this change may show some compiler bugs that
> 	we thought we were already testing for.

I think it would be better to change the mmake files to use EXTRA_CFLAGS
and EXTRA_MCFLAGS.

In fact it would be a good idea to change scripts/Mmake.vars.
It should define

	MCFLAGS = $(EXTRA_MCFLAGS)

and similarly for all those other variables, we should document in the
user's guide that these EXTRA_* variables are intended to be used for
adding extra flags on the command line.

> tests/*/runtests:
> 	Don't pass empty strings as arguments to mmake, as this can
> 	tickle bugs in make.

The solution you used is quite ugly:

>  	-c|--cflags)
>  		cflag="-c '$2'"
> -		cflagsopt="EXTRA_CFLAGS=$2"
> +		cflagsopt="MGNUCFLAGS=$2"
[...]
> -mmake -k $jfactor $gradeopt "$flagsopt" "$cflagsopt" check
> +
> +if [ -n "$flagsopt" ] ; then
> +	if [ -n "$cflagsopt" ] ; then
> +		mmake -k $jfactor $gradeopt "$flagsopt" "$cflagsopt" 
> +	else
> +		mmake -k $jfactor $gradeopt "$flagsopt"
> +	fi
> +else
> +	if [ -n "$cflagsopt" ] ; then
> +		mmake -k $jfactor $gradeopt "$cflagsopt" 
> +	else
> +		mmake -k $jfactor $gradeopt 
> +	fi
> +fi
> +

I suggest that you use

		cflagsopt="EXTRA_CFLAGS='$2'"

and then use `eval', as is done for the `-c' option.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list