Files
mercury/tools/cur_param
Zoltan Somogyi e9addb8cd1 By default, execute all the tests after verifying that the compiler
Estimated hours taken: 2

bootcheck:
	By default, execute all the tests after verifying that the compiler
	compiles itself to a fix point. Don't execute the tests if called
	with the -t option.

makebatch:
	Pass the -t option to bootcheck if makebatch is itself called with -t.

test_mercury:
	Run the tests on the bootstrapped compiler *before* installing it,
	and don't install it unless it passes all the tests.

	Cycle through a list of different parameter settings, so that
	in general different nightly runs use different sets of options.
	Call bootcheck with -r, since some of these options may cause
	a compilation model difference between the current and new compiler.

list.*:
	Lists of parameter settings for various machines.

expand_params:
	Expand the paramater settings from one line of a list.x file
	into a Mmake.param file

cur_param:
	Report which line in a list.x file is the current one.

next_param:
	Advance the current line in a list.x file. When we reach the end,
	we start again at the start.
1996-11-05 01:03:17 +00:00

49 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
#
# The scripts cur_param and next_param allow their callers to cycle through
# circular lists of parameters. Both scripts take two parameters, a directory
# name and a counter name.
#
# The idea is that the user sets up the file $dir/list.$counter to contain
# a list of parameters, one per line. Each time the user calls cur_param,
# they get back as the output of the script the current parameter (initially
# the first). Each time the user calls next_param, the scripts' notion of
# the current parameter is set to the parameter on the next line of the file,
# or, if there are none left, back to the parameter on the first line.
# next_param has only this side-effect; it does not output anything.
#
# Both scripts exit with a non-zero status in case of internal error.
usage="cur_param dir counter"
if test $# != 2
then
echo $usage
exit 1
fi
dir=$1
counter=$2
if test ! -f $dir/next.$counter
then
echo 1 > $dir/next.$counter
fi
if test -s $dir/list.$counter
then
cur=`cat $dir/next.$counter`
if awk "NR == $cur" $dir/list.$counter
then
true
else
echo "$dir/list.$counter isn't long enough"
exit 1
fi
else
echo "$dir/list.$counter doesn't exist or is empty"
exit 1
fi
exit 0