Skip to content
GitLab
Menu
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
f80fdc5a
Commit
f80fdc5a
authored
Mar 31, 2007
by
Ian Lynagh
Browse files
Time how long is spent on each .T file
parent
98d41569
Changes
2
Hide whitespace changes
Inline
Side-by-side
testsuite/driver/runtests.py
View file @
f80fdc5a
...
...
@@ -10,6 +10,7 @@ import sys
import
os
import
string
import
getopt
import
time
from
testutil
import
*
from
testglobals
import
*
...
...
@@ -47,6 +48,9 @@ for opt,arg in opts:
if
opt
==
'--output-summary'
:
config
.
output_summary
=
arg
if
opt
==
'--times-file'
:
config
.
times_file
=
arg
if
opt
==
'--only'
:
config
.
only
.
append
(
arg
)
...
...
@@ -104,13 +108,18 @@ print 'Beginning test run at', t.start_time
sys
.
stdout
.
flush
()
sys
.
stdout
=
os
.
fdopen
(
sys
.
__stdout__
.
fileno
(),
"w"
,
0
)
times
=
{}
for
file
in
t_files
:
print
'====> Running'
,
file
newTestDir
(
os
.
path
.
dirname
(
file
))
try
:
if
config
.
use_threads
:
t
.
running_threads
=
0
start
=
time
.
time
()
execfile
(
file
)
end
=
time
.
time
()
times
[
file
]
=
end
-
start
if
config
.
use_threads
:
t
.
thread_pool
.
acquire
()
while
t
.
running_threads
>
0
:
...
...
@@ -125,5 +134,11 @@ summary(t, sys.stdout)
if
config
.
output_summary
!=
''
:
summary
(
t
,
open
(
config
.
output_summary
,
'w'
))
if
config
.
times_file
!=
''
:
h
=
open
(
config
.
times_file
,
'w'
)
for
(
k
,
v
)
in
times
.
items
():
h
.
write
(
k
+
','
+
str
(
v
)
+
'
\n
'
)
h
.
close
()
sys
.
exit
(
0
)
testsuite/driver/testglobals.py
View file @
f80fdc5a
...
...
@@ -28,6 +28,9 @@ class TestConfig:
# File in which to save the summary
self
.
output_summary
=
''
# File in which to save the times
self
.
times_file
=
''
# What platform are we running on?
self
.
platform
=
''
...
...
Write
Preview
Supports
Markdown
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