Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QueryR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Lopez
QueryR
Commits
9ed877f4
Commit
9ed877f4
authored
7 years ago
by
Florian Angerer
Browse files
Options
Downloads
Patches
Plain Diff
Added test traits to ignore some unimportant differences in the debugger's output.
parent
1b3c812e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/TestBase.java
+40
-1
40 additions, 1 deletion
...ruffle.r.test/src/com/oracle/truffle/r/test/TestBase.java
with
40 additions
and
1 deletion
com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/TestBase.java
+
40
−
1
View file @
9ed877f4
...
...
@@ -77,7 +77,10 @@ public class TestBase {
MayIgnoreWarningContext
,
ContainsReferences
,
// replaces references in form of 0xbcdef1 for numbers
IgnoreWhitespace
,
// removes all whitespace from the whole output
IgnoreCase
;
// ignores upper/lower case differences
IgnoreCase
,
// ignores upper/lower case differences
IgnoreDebugPath
,
// ignores <path> in debug output like "debug at <path> #..."
IgnoreDebugDepth
,
// ignores call depth printed by the debugger ("Browse[<call depth>]")
IgnoreDebugExitFrom
;
// ignores the debugger's "exiting from ..."
@Override
public
String
getName
()
{
...
...
@@ -608,6 +611,15 @@ public class TestBase {
if
(
output
.
contains
(
Output
.
ContainsReferences
))
{
return
convertReferencesInOutput
(
out
);
}
if
(
output
.
contains
(
Output
.
IgnoreDebugPath
))
{
return
convertDebugOutput
(
out
);
}
if
(
output
.
contains
(
Output
.
IgnoreDebugExitFrom
))
{
return
removeExitingFrom
(
out
);
}
if
(
output
.
contains
(
Output
.
IgnoreDebugDepth
))
{
return
removeDebugCallDepth
(
out
);
}
return
out
;
}
}
...
...
@@ -731,6 +743,33 @@ public class TestBase {
return
result
;
}
private
static
String
convertDebugOutput
(
String
out
)
{
String
prefix
=
"debug at "
;
return
removeAllOccurrencesBetween
(
out
,
prefix
,
prefix
.
length
(),
"#"
,
0
);
}
private
static
String
removeExitingFrom
(
String
out
)
{
return
removeAllOccurrencesBetween
(
out
,
"exiting from:"
,
0
,
"\n"
,
1
);
}
private
static
String
removeDebugCallDepth
(
String
out
)
{
String
prefix
=
"Browse["
;
return
removeAllOccurrencesBetween
(
out
,
prefix
,
prefix
.
length
(),
"]"
,
0
);
}
private
static
String
removeAllOccurrencesBetween
(
String
out
,
String
prefix
,
int
prefixOffset
,
String
suffix
,
int
suffixOffset
)
{
StringBuilder
sb
=
new
StringBuilder
(
out
);
int
idxPrefix
=
-
1
;
int
idxSuffix
=
-
1
;
while
((
idxPrefix
=
sb
.
indexOf
(
prefix
,
idxPrefix
+
1
))
>
0
&&
(
idxSuffix
=
sb
.
indexOf
(
suffix
,
idxPrefix
))
>
idxPrefix
)
{
sb
.
replace
(
idxPrefix
+
prefixOffset
,
idxSuffix
+
suffixOffset
,
""
);
}
return
sb
.
toString
();
}
private
boolean
searchWhiteLists
(
WhiteList
[]
whiteLists
,
String
input
,
String
expected
,
String
result
,
TestTraitsSet
testTraits
)
{
if
(
whiteLists
==
null
)
{
return
false
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment