Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
176be87c
Commit
176be87c
authored
Feb 22, 2016
by
thomie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter out -prof callstacks from test output (#11521)
parent
73e40955
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
testsuite/driver/testglobals.py
testsuite/driver/testglobals.py
+3
-0
testsuite/driver/testlib.py
testsuite/driver/testlib.py
+16
-3
testsuite/tests/profiling/should_run/all.T
testsuite/tests/profiling/should_run/all.T
+1
-0
No files found.
testsuite/driver/testglobals.py
View file @
176be87c
...
...
@@ -265,6 +265,9 @@ class TestOptions:
# Extra normalisation for compiler error messages
self
.
extra_errmsg_normaliser
=
lambda
x
:
x
# Keep profiling callstacks.
self
.
keep_prof_callstacks
=
False
# The directory the test is in
self
.
testdir
=
'.'
...
...
testsuite/driver/testlib.py
View file @
176be87c
...
...
@@ -494,6 +494,13 @@ def normalise_drive_letter(name, opts):
# Windows only. Change D:\\ to C:\\.
_normalise_fun
(
name
,
opts
,
lambda
str
:
re
.
sub
(
r'[A-Z]:\\'
,
r'C:\\'
,
str
))
def
keep_prof_callstacks
(
name
,
opts
):
"""Keep profiling callstacks.
Use together with `only_ways(prof_ways)`.
"""
opts
.
keep_prof_callstacks
=
True
def
join_normalisers
(
*
a
):
"""
Compose functions, flattening sequences.
...
...
@@ -1669,15 +1676,21 @@ def normalise_whitespace( str ):
callSite_re
=
re
.
compile
(
r', called at (.+):[\d]+:[\d]+ in [\w\-\.]+:'
)
def
normalise_callstacks
(
str
):
def
normalise_callstacks
(
s
):
opts
=
getTestOpts
()
def
repl
(
matches
):
location
=
matches
.
group
(
1
)
location
=
normalise_slashes_
(
location
)
return
', called at {0}:<line>:<column> in <package-id>:'
.
format
(
location
)
# Ignore line number differences in call stacks (#10834).
s
tr1
=
re
.
sub
(
callSite_re
,
repl
,
str
)
s
=
re
.
sub
(
callSite_re
,
repl
,
s
)
# Ignore the change in how we identify implicit call-stacks
return
str1
.
replace
(
'from ImplicitParams'
,
'from HasCallStack'
)
s
=
s
.
replace
(
'from ImplicitParams'
,
'from HasCallStack'
)
if
not
opts
.
keep_prof_callstacks
:
# Don't output prof callstacks. Test output should be
# independent from the WAY we run the test.
s
=
re
.
sub
(
r'CallStack \(from -prof\):(\n .*)*\n?'
,
''
,
s
)
return
s
tyCon_re
=
re
.
compile
(
r'TyCon\s*\d+L?\#\#\s*\d+L?\#\#\s*'
,
flags
=
re
.
MULTILINE
)
...
...
testsuite/tests/profiling/should_run/all.T
View file @
176be87c
...
...
@@ -15,6 +15,7 @@ test('T11489', [req_profiling, extra_clean(['T11489.prof', 'T11489.hp'])],
setTestOpts
(
req_profiling
)
setTestOpts
(
extra_ways
(['
prof
']))
setTestOpts
(
only_ways
(
prof_ways
))
setTestOpts
(
keep_prof_callstacks
)
extra_prof_ways
=
['
prof
',
'
prof_hc_hb
',
'
prof_hb
',
'
prof_hd
',
'
prof_hy
',
'
prof_hr
']
...
...
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