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
62d79290
Commit
62d79290
authored
Aug 02, 2007
by
Ian Lynagh
Browse files
Define and use rawSystem in the testsuite driver and the driver tests
spawnlp doesn't exist in Windows, so this avoids using it.
parent
e448217e
Changes
2
Hide whitespace changes
Inline
Side-by-side
testsuite/driver/testlib.py
View file @
62d79290
...
...
@@ -1061,6 +1061,20 @@ def guess_compiler_flags():
else
:
return
[]
def
rawSystem
(
cmd_and_args
):
# We prefer subprocess.call to os.spawnv as the latter
# seems to send its arguments through a shell or something
# with the Windows (non-cygwin) python. An argument "a b c"
# turns into three arguments ["a", "b", "c"].
# However, subprocess is new in python 2.4, so fall back to
# using spawnv if we don't have it
if
have_subprocess
:
return
subprocess
.
call
(
cmd_and_args
)
else
:
return
os
.
spawnv
(
os
.
P_WAIT
,
cmd_and_args
[
0
],
cmd_and_args
)
# cmd is a complex command in Bourne-shell syntax
# e.g (cd . && 'c:/users/simonpj/darcs/HEAD/compiler/stage1/ghc-inplace' ...etc)
# Hence it must ultimately be run by a Bourne shell
...
...
@@ -1080,19 +1094,7 @@ def runCmd( cmd ):
assert
config
.
timeout_prog
!=
''
if
config
.
timeout_prog
!=
''
:
# We prefer subprocess.call to os.spawnv as the latter
# seems to send its arguments through a shell or something
# with the Windows (non-cygwin) python. An argument "a b c"
# turns into three arguments ["a", "b", "c"].
# However, subprocess is new in python 2.4, so fall back to
# using spawnv if we don't have it
if
have_subprocess
:
r
=
subprocess
.
call
([
config
.
timeout_prog
,
str
(
config
.
timeout
),
cmd
])
else
:
r
=
os
.
spawnv
(
os
.
P_WAIT
,
config
.
timeout_prog
,
[
config
.
timeout_prog
,
str
(
config
.
timeout
),
cmd
])
r
=
rawSystem
([
config
.
timeout_prog
,
str
(
config
.
timeout
),
cmd
])
else
:
r
=
os
.
system
(
cmd
)
return
r
<<
8
...
...
testsuite/tests/ghc-regress/driver/all.T
View file @
62d79290
...
...
@@ -10,9 +10,9 @@ def cleanall():
'
depend
',
'
depend.bak
',
'
hello
'])
if
default_testopts
.
cleanup
!=
'':
os
.
spawnlp
(
os
.
P_WAIT
,
'
rm
',
'
rm
',
'
-rf
',
in_testdir
('
hi
'))
os
.
spawnlp
(
os
.
P_WAIT
,
'
rm
',
'
rm
',
'
-rf
',
in_testdir
('
obj
'))
os
.
spawnlp
(
os
.
P_WAIT
,
'
rm
',
'
rm
',
'
-rf
',
in_testdir
('
stub
'))
rawSystem
([
'
rm
',
'
-rf
',
in_testdir
('
hi
')
]
)
rawSystem
([
'
rm
',
'
-rf
',
in_testdir
('
obj
')
]
)
rawSystem
([
'
rm
',
'
-rf
',
in_testdir
('
stub
')
]
)
test
('
driver011
',
ignore_output
,
run_command
,
['
$MAKE test011
'])
cleanall
()
...
...
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