Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
f7434a7c
Commit
f7434a7c
authored
Sep 13, 2007
by
Simon Marlow
Browse files
Allow files-to-cleanup to be attached to a test using extra_clean(files)
This is better than a top-level clean() when using threads
parent
69d9ed0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
testsuite/driver/testglobals.py
View file @
f7434a7c
...
...
@@ -138,10 +138,10 @@ class TestOptions:
self
.
extra_ways
=
[]
# the result we normally expect for this test
self
.
expect
=
'pass'
;
self
.
expect
=
'pass'
# override the expected result for certain ways
self
.
expect_fail_for
=
[]
;
self
.
expect_fail_for
=
[]
# the stdin file that this test will use (empty for <name>.stdin)
self
.
stdin
=
''
...
...
@@ -167,6 +167,9 @@ class TestOptions:
# should we clean up after ourselves?
self
.
cleanup
=
''
# extra files to clean afterward
self
.
clean_files
=
[]
# should we run this test alone, i.e. not run it in parallel with
# any other threads
self
.
alone
=
0
...
...
testsuite/driver/testlib.py
View file @
f7434a7c
...
...
@@ -232,9 +232,17 @@ def extra_run_opts( val ):
def
_extra_run_opts
(
opts
,
v
):
opts
.
extra_run_opts
=
v
# -----
def
no_clean
(
opts
):
opts
.
cleanup
=
''
;
def
extra_clean
(
files
):
return
lambda
opts
,
v
=
files
:
_extra_clean
(
opts
,
v
);
def
_extra_clean
(
opts
,
v
):
opts
.
clean_files
=
v
# -----
def
skip_if_no_ghci
(
opts
):
...
...
@@ -409,6 +417,8 @@ def test_common_work (name, opts, func, args):
'.hi'
,
'.o'
,
'.prof'
,
'.exe.prof'
,
'.hc'
,
'_stub.h'
,
'_stub.c'
,
'_stub.o'
,
'.hp'
,
'.exe.hp'
,
'.ps'
,
'.aux'
,
'.hcr'
]))
clean
(
getTestOpts
().
clean_files
)
def
clean
(
names
):
clean_full_paths
(
map
(
lambda
name
:
in_testdir
(
name
),
names
))
...
...
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