Commit 398fa58f authored by rje's avatar rje

[project @ 2002-03-15 16:07:58 by rje]

Add ability for NoFib to be run with various different modes.

The mode is set by changing a variable called "mode".

This allows tests to be run for different lengths of time, depending on what kin
d of test is wanted.

Current modes are:

<unset> = default mode. Like previous NoFib.
"slow" = tries to run for around 10-20 seconds on my workstation.

A test is given several modes by giving it the following:
        <test>.stdout -> <test>.<mode>stdout
        <test>.stdin -> <test>.<mode>stdin

Args are set in the makefile as

<mode>_OPTS
parent 66f2aa34
......@@ -2,7 +2,7 @@
#
# nofib/mk/opts.mk
#
# $Id: opts.mk,v 1.6 2001/04/03 20:12:38 hwloidl Exp $
# $Id: opts.mk,v 1.7 2002/03/15 16:07:58 rje Exp $
#
#################################################################################
......@@ -13,7 +13,8 @@
# to configure (and override) the options to run a particular test
# with.
RUNTEST_OPTS = $(SRC_RUNTEST_OPTS) $(WAY$(_way)_RUNTEST_OPTS) \
$($(NOFIB_PROG)_RUNTEST_OPTS) $(EXTRA_RUNTEST_OPTS)
$($(NOFIB_PROG)_RUNTEST_OPTS) $(EXTRA_RUNTEST_OPTS) \
$(TEST_OPTS)
ifneq "$(way)" "mp"
# if testing GUM don't generate a -S style log file; it may well differ
......@@ -26,4 +27,14 @@ SRC_RUNTEST_OPTS += +RTS -H10m -K10m -RTS
#
SRC_HC_OPTS += -H32m -hisuf $(way_)hi
#mode = "slow"
ifeq "$(mode)" "slow"
TEST_OPTS = $(SLOW_OPTS)
else
ifeq "$(mode)" "fast"
TEST_OPTS = $(FAST_OPTS)
else
TEST_OPTS = $(NORM_OPTS)
endif
endif
......@@ -30,6 +30,8 @@ all ::
all :: runtests
endif
# Bogosity needed here to cope with .exe suffix for strip & size files.
# (shouldn't have to be our problem.)
ifneq "$(HC_FAIL)" "YES"
......@@ -42,7 +44,7 @@ endif
ifeq "$(STDIN_FILE)" ""
STDIN_FILE = $(wildcard $(NOFIB_PROG).stdin)
STDIN_FILE = $(wildcard $(NOFIB_PROG).$(mode)stdin)
endif
ifeq "$(NoFibWithGHCi)" "YES"
......@@ -74,7 +76,7 @@ runtests :: $(NOFIB_PROG_WAY) size
@echo ==nofib$(_way)== $(NOFIB_PROG): run the following command by hand
@echo ./$< $(RUNTEST_OPTS) $(PROG_ARGS)
@echo ==nofib$(_way)== $(NOFIB_PROG): output should be
@cat $(wildcard $(NOFIB_PROG).stdout*)
@cat $(wildcard $(NOFIB_PROG).$(mode)stdout*)
else
size :: $(NOFIB_PROG_WAY)
......@@ -85,9 +87,9 @@ size :: $(NOFIB_PROG_WAY)
runtests :: $(NOFIB_PROG_WAY) size
@echo ==nofib$(_way)== $(NOFIB_PROG): time to run $(NOFIB_PROG) follows...
@$(TIME) $(RUNTEST) ./$< \
$(addprefix -i, $(STDIN_FILE)) \
$(addprefix -o1 ,$(wildcard $(NOFIB_PROG).stdout*)) \
$(addprefix -o2 ,$(wildcard $(NOFIB_PROG).stderr*)) \
$(addprefix -i ,$(STDIN_FILE)) \
$(addprefix -o1 ,$(wildcard $(NOFIB_PROG).$(mode)stdout*)) \
$(addprefix -o2 ,$(wildcard $(NOFIB_PROG).$(mode)stderr*)) \
$(RUNTEST_OPTS) $(PROG_ARGS)
endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment