Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
e7841b85
Commit
e7841b85
authored
Dec 19, 2009
by
Ian Lynagh
Browse files
Add pre-command support to the testsuite, and fix annrun01 by using it
parent
5a035653
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/driver/testglobals.py
View file @
e7841b85
...
...
@@ -202,6 +202,9 @@ class TestOptions:
# Does this test use a .c file?
self
.
c_src
=
0
# Command to run before the test
self
.
pre_cmd
=
None
# Prefix to put on the command before running it
self
.
cmd_prefix
=
''
...
...
testsuite/driver/testlib.py
View file @
e7841b85
...
...
@@ -353,6 +353,14 @@ def c_src( opts ):
# ----
def
pre_cmd
(
cmd
):
return
lambda
opts
,
c
=
cmd
:
_pre_cmd
(
opts
,
cmd
)
def
_pre_cmd
(
opts
,
cmd
):
opts
.
pre_cmd
=
cmd
# ----
def
cmd_prefix
(
prefix
):
return
lambda
opts
,
p
=
prefix
:
_cmd_prefix
(
opts
,
prefix
)
...
...
@@ -537,6 +545,17 @@ def do_test(name, way, func, args):
if
config
.
use_threads
:
t
.
lock
.
release
()
try
:
preCmd
=
getTestOpts
().
pre_cmd
print
preCmd
if
preCmd
!=
None
:
result
=
runCmd
(
'cd '
+
getTestOpts
().
testdir
+
' && '
+
preCmd
)
if
result
!=
0
:
framework_fail
(
name
,
way
,
'pre-command failed: '
+
str
(
result
))
except
e
:
framework_fail
(
name
,
way
,
'pre-command exception'
)
try
:
result
=
apply
(
func
,
[
name
,
way
]
+
args
)
finally
:
...
...
testsuite/tests/ghc-regress/annotations/should_run/all.T
View file @
e7841b85
...
...
@@ -2,8 +2,6 @@
# These tests are very slow due to their use of package GHC
setTestOpts
(
compose
(
skip_if_fast
,
if_compiler_lt
('
ghc
',
'
6.11
',
skip
)));
runCmd
('
$MAKE -C
'
+
in_testdir
('')
+
'
config
')
# Annotations, like Template Haskell, require runtime evaluation. In
# order for this to work with profiling, we would have to build the
# program twice and use -osuf p_o (see the TH_splitE5_prof test). For
...
...
@@ -11,6 +9,7 @@ runCmd('$MAKE -C ' + in_testdir('') + ' config')
test
('
annrun01
',
[
extra_clean
(['
Annrun01_Help.hi
',
'
Annrun01_Help.o
',
'
annrun01.hi
',
'
annrun01.o
']),
pre_cmd
('
$MAKE config
'),
omit_ways
(['
profc
','
profasm
','
profthreaded
'])],
multimod_compile_and_run
,
['
annrun01
',
'
-package ghc
']
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment