Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
d268747e
Commit
d268747e
authored
Sep 09, 2004
by
igloo
Browse files
[project @ 2004-09-09 16:15:24 by igloo]
Testsuite cleaning.
parent
fd396161
Changes
64
Hide whitespace changes
Inline
Side-by-side
testsuite/README
View file @
d268747e
...
...
@@ -177,6 +177,7 @@ these steps:
set_stdin(file) use a different file for stdin
exit_code(n) expect an exit code of 'n' from the prog
extra_run_opts(opts) pass some extra opts to the prog
no_clean don't clean up after this test
you can compose two of these functions together by
saying compose(f,g). For example, to expect an exit
...
...
testsuite/driver/testlib.py
View file @
d268747e
...
...
@@ -8,6 +8,7 @@ import string
import
re
import
traceback
import
copy
import
glob
from
string
import
join
from
testutil
import
*
...
...
@@ -134,6 +135,10 @@ class TestOptions:
# expected exit code
self
.
exit_code
=
0
# should we clean up after ourselves?
self
.
cleanup
=
''
# The default set of options
global
default_testopts
...
...
@@ -243,6 +248,9 @@ def extra_run_opts( val ):
def
_extra_run_opts
(
opts
,
v
):
opts
.
extra_run_opts
=
v
def
no_clean
(
opts
):
opts
.
cleanup
=
''
;
# ----
# Function for composing two opt-fns together
...
...
@@ -291,6 +299,24 @@ def test( name, setup, func, args ):
for
way
in
ways
:
do_test
(
name
,
way
,
setup
,
func
,
args
)
clean
(
map
(
lambda
suff
:
name
+
suff
,
[
''
,
'.genscript'
,
'.run.stderr'
,
'.run.stdout'
,
'.comp.stderr'
,
'.comp.stdout'
,
'.interp.stderr'
,
'.interp.stdout'
,
'.hi'
,
'.o'
,
'.prof'
,
'.hc'
,
'_stub.h'
,
'_stub.c'
,
'_stub.o'
]))
def
clean
(
names
):
clean_full_paths
(
map
(
lambda
name
:
in_testdir
(
name
),
names
))
def
clean_o_hi
():
clean_full_paths
(
glob
.
glob
(
in_testdir
(
'*.o'
))
+
glob
.
glob
(
in_testdir
(
'*.hi'
)))
def
clean_full_paths
(
names
):
if
testopts
.
cleanup
!=
''
:
for
name
in
names
:
if
os
.
access
(
name
,
os
.
F_OK
)
:
os
.
remove
(
name
)
def
do_test
(
name
,
way
,
setup
,
func
,
args
):
full_name
=
name
+
'('
+
way
+
')'
...
...
testsuite/mk/test.mk
View file @
d268747e
...
...
@@ -67,6 +67,7 @@ RUNTEST_OPTS += \
-e
config.compiler_always_flags.append
"(
\"
$(EXTRA_HC_OPTS)
\"
)"
\
-e
config.platform
=
\"
$(TARGETPLATFORM)
\"
\
-e
config.wordsize
=
\"
$(WORDSIZE)
\"
\
-e
default_testopts.cleanup
=
\"
$(CLEANUP)
\"
\
$(EXTRA_RUNTEST_OPTS)
TESTS
=
...
...
testsuite/tests/ghc-regress/ccall/should_run/all.T
View file @
d268747e
...
...
@@ -15,6 +15,7 @@ test('fed001', expect_fail_for(['extcore','optextcore']), compile_and_run, [''])
# Omit GHCi for these two, as they use foreign export
test
('
ffi001
',
omit_ways
(['
ghci
']),
compile_and_run
,
[''])
test
('
ffi002
',
omit_ways
(['
ghci
']),
compile_and_run
,
['
ffi002_c.c -no-hs-main
'])
clean
(['
ffi002_c.o
'])
if
config
.
platform
==
'
alpha-dec-osf3
':
f
=
skip
...
...
testsuite/tests/ghc-regress/cpranal/should_compile/all.T
View file @
d268747e
...
...
@@ -4,5 +4,6 @@ def f( opts ):
setTestOpts
(
f
)
test
('
Cpr001_imp
',
no
rmal
,
compile
,
[''])
test
('
Cpr001_imp
',
no
_clean
,
compile
,
[''])
test
('
Cpr001
',
normal
,
compile
,
[''])
clean
(['
Cpr001_imp.hi
',
'
Cpr001_imp.o
',
'
Cpr001_imp.comp.stderr
'])
testsuite/tests/ghc-regress/driver/all.T
View file @
d268747e
...
...
@@ -23,3 +23,10 @@ test('driver060', normal, run_command_ignore_output, ['$MAKE test060'])
test
('
driver061
',
normal
,
run_command_ignore_output
,
['
$MAKE test061
'])
test
('
driver062
',
normal
,
run_command_ignore_output
,
['
$MAKE test062
'])
test
('
driver063
',
normal
,
run_command
,
['
$MAKE -s --no-print-directory test063
'])
clean
(['
B/C.hi
',
'
B/C.o
',
'
B/C.ooo
',
'
B/C.xhi
',
'
d1/P/Q.o
',
'
d2/R/S.o
',
'
d1/P/Q.hi
',
'
d2/R/S.hi
',
'
A.ooo
',
'
A.xhi
',
'
Hello.hi
',
'
Hello.o
',
'
hello
'])
if
default_testopts
.
cleanup
!=
'':
os
.
spawnlp
(
os
.
P_WAIT
,
'
rm
',
'
rm
',
'
-rf
',
in_testdir
('
obj
'))
os
.
spawnlp
(
os
.
P_WAIT
,
'
rm
',
'
rm
',
'
-rf
',
in_testdir
('
hi
'))
testsuite/tests/ghc-regress/ghci/prog001/prog001.T
View file @
d268747e
test
('
prog001
',
normal
,
ghci_script
,
['
prog001.script
'])
clean
(['
D.hi
',
'
D.o
'])
testsuite/tests/ghc-regress/ghci/prog002/prog002.T
View file @
d268747e
test
('
prog002
',
normal
,
ghci_script
,
['
prog002.script
'])
clean
(['
A.hi
'])
testsuite/tests/ghc-regress/ghci/prog003/prog003.T
View file @
d268747e
test
('
prog003
',
normal
,
ghci_script
,
['
prog003.script
'])
clean
(['
D.hi
',
'
C.hi
',
'
C.o
',
'
B.hi
',
'
B.o
',
'
A.hi
',
'
A.o
',
'
a.out
'])
testsuite/tests/ghc-regress/lib/Generics/bits/test.T
View file @
d268747e
...
...
@@ -3,3 +3,4 @@ test( 'bits',
multimod_compile_and_run
,
['
Main
','']
)
clean
(['
CompanyDatatypes.hi
',
'
CompanyDatatypes.o
',
'
Main.hi
',
'
Main.o
'])
testsuite/tests/ghc-regress/lib/Generics/ext1/test.T
View file @
d268747e
...
...
@@ -3,3 +3,4 @@ test( 'ext1',
multimod_compile_and_run
,
['
Main
','']
)
clean
(['
Main.hi
',
'
Main.o
'])
testsuite/tests/ghc-regress/lib/Generics/freeNames/test.T
View file @
d268747e
...
...
@@ -3,3 +3,4 @@ test( 'freeNames',
multimod_compile_and_run
,
['
Main
','']
)
clean
(['
FunDatatypes.hi
',
'
FunDatatypes.o
',
'
Main.hi
',
'
Main.o
'])
testsuite/tests/ghc-regress/lib/Generics/genUpTo/test.T
View file @
d268747e
...
...
@@ -3,3 +3,4 @@ test( 'genUpTo',
multimod_compile_and_run
,
['
Main
','']
)
clean
(['
LittleLanguage.hi
',
'
LittleLanguage.o
',
'
Main.hi
',
'
Main.o
'])
testsuite/tests/ghc-regress/lib/Generics/geq/test.T
View file @
d268747e
...
...
@@ -3,3 +3,4 @@ test( 'geq',
multimod_compile_and_run
,
['
Main
','']
)
clean
(['
CompanyDatatypes.hi
',
'
CompanyDatatypes.o
',
'
Main.hi
',
'
Main.o
'])
testsuite/tests/ghc-regress/lib/Generics/gshow/test.T
View file @
d268747e
...
...
@@ -3,3 +3,4 @@ test( 'gshow',
multimod_compile_and_run
,
['
Main
','']
)
clean
(['
CompanyDatatypes.hi
',
'
CompanyDatatypes.o
',
'
Main.hi
',
'
Main.o
'])
testsuite/tests/ghc-regress/lib/Generics/gzip/test.T
View file @
d268747e
...
...
@@ -3,3 +3,4 @@ test( 'gzip',
multimod_compile_and_run
,
['
Main
','']
)
clean
(['
CompanyDatatypes.hi
',
'
CompanyDatatypes.o
',
'
Main.hi
',
'
Main.o
'])
testsuite/tests/ghc-regress/lib/Generics/paradise/test.T
View file @
d268747e
...
...
@@ -3,3 +3,4 @@ test( 'paradise',
multimod_compile_and_run
,
['
Main
','']
)
clean
(['
CompanyDatatypes.hi
',
'
CompanyDatatypes.o
',
'
Main.hi
',
'
Main.o
'])
testsuite/tests/ghc-regress/lib/Generics/reify/test.T
View file @
d268747e
...
...
@@ -3,3 +3,4 @@ test( 'reify',
multimod_compile_and_run
,
['
Main
','']
)
clean
(['
CompanyDatatypes.hi
',
'
CompanyDatatypes.o
',
'
Main.hi
',
'
Main.o
'])
testsuite/tests/ghc-regress/lib/Generics/strings/test.T
View file @
d268747e
...
...
@@ -3,3 +3,4 @@ test( 'strings',
multimod_compile_and_run
,
['
Main
','']
)
clean
(['
CompanyDatatypes.hi
',
'
CompanyDatatypes.o
',
'
Main.hi
',
'
Main.o
'])
testsuite/tests/ghc-regress/lib/Generics/tree/test.T
View file @
d268747e
...
...
@@ -3,3 +3,4 @@ test( 'tree',
multimod_compile_and_run
,
['
Main
','']
)
clean
(['
CompanyDatatypes.hi
',
'
CompanyDatatypes.o
',
'
Main.hi
',
'
Main.o
'])
Prev
1
2
3
4
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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