Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
javawlp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
impresshs
javawlp
Commits
4cc6d2c3
Commit
4cc6d2c3
authored
7 years ago
by
Orestis Melkonian
Browse files
Options
Downloads
Patches
Plain Diff
Tests: silence stderr
parent
3f105397
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/Spec.hs
+1
-1
1 addition, 1 deletion
test/Spec.hs
test/TEquivalenceClasses.hs
+8
-7
8 additions, 7 deletions
test/TEquivalenceClasses.hs
test/TExamples.hs
+6
-5
6 additions, 5 deletions
test/TExamples.hs
with
15 additions
and
13 deletions
test/Spec.hs
+
1
−
1
View file @
4cc6d2c3
...
...
@@ -10,8 +10,8 @@ main = defaultMain
[
constructTestSuite
testName
testSuite
|
(
testName
,
testSuite
)
<-
[
(
"LIR_PARSER"
,
parserTests
)
,
(
"EXAMPLES"
,
examples
)
,
(
"MODEL_PARSER"
,
modelParserTests
)
,
(
"EXAMPLES"
,
examples
)
,
(
"EQUIV_REAL"
,
genEquivTests
"examples/test_equiv/Reals.java"
)
,
(
"EQUIV_ARRAY"
,
genEquivTests
"examples/test_equiv/Arrays.java"
)
]
...
...
This diff is collapsed.
Click to expand it.
test/TEquivalenceClasses.hs
+
8
−
7
View file @
4cc6d2c3
module
TEquivalenceClasses
where
import
Control.Monad
import
Data.List
(
elemIndex
)
import
Data.List.Split
(
splitOn
)
import
Data.List
(
elemIndex
)
import
Data.List.Split
(
splitOn
)
import
Data.Maybe
import
System.IO.Silently
(
silence
)
import
System.IO.Unsafe
(
unsafePerformIO
)
import
System.IO
(
stderr
,
stdout
)
import
System.IO.Silently
(
hSilence
)
import
System.IO.Unsafe
(
unsafePerformIO
)
import
Test.HUnit
import
API
import
Javawlp.Engine.HelperFunctions
(
parseMethodIds
)
import
Model
import
API
testEquiv
::
Response
->
String
->
String
->
String
->
Assertion
testEquiv
b
src
s
s'
=
(
case
unsafePerformIO
(
s
ilence
$
compareSpec
Debug
File
(
src
,
s
)
(
src
,
s'
))
of
(
case
unsafePerformIO
(
hS
ilence
[
stdout
,
stderr
]
$
compareSpec
Debug
File
(
src
,
s
)
(
src
,
s'
))
of
NotEquivalent
x
->
NotEquivalent
emptyModel
x
->
x
)
@?=
b
...
...
@@ -22,7 +23,7 @@ testEquiv b src s s' =
(
.!=
)
=
testEquiv
$
NotEquivalent
emptyModel
genEquivTests
edslSrc
=
let
methodIds
=
unsafePerformIO
(
s
ilence
$
parseMethodIds
edslSrc
)
let
methodIds
=
unsafePerformIO
(
hS
ilence
[
stdout
,
stderr
]
$
parseMethodIds
edslSrc
)
getClass
=
last
.
splitOn
"_"
tailFrom
::
Eq
a
=>
[
a
]
->
a
->
[
a
]
tailFrom
xs
x
=
case
elemIndex
x
xs
of
Just
i
->
snd
$
splitAt
i
xs
...
...
This diff is collapsed.
Click to expand it.
test/TExamples.hs
+
6
−
5
View file @
4cc6d2c3
module
TExamples
where
import
System.IO.Unsafe
(
unsafePerformIO
)
import
System.IO.Silently
(
silence
)
import
System.IO
(
stderr
,
stdout
)
import
System.IO.Silently
(
hSilence
)
import
System.IO.Unsafe
(
unsafePerformIO
)
import
Test.HUnit
import
Model
import
API
import
Model
src
=
"examples/javawlp_edsl/src/nl/uu/javawlp_edsl/Main.java"
testEquiv
::
Response
->
String
->
String
->
Assertion
testEquiv
b
s
s'
=
(
case
unsafePerformIO
(
s
ilence
$
compareSpec
Debug
File
(
src
,
s
)
(
src
,
s'
))
of
(
case
unsafePerformIO
(
hS
ilence
[
stdout
,
stderr
]
$
compareSpec
Debug
File
(
src
,
s
)
(
src
,
s'
))
of
NotEquivalent
_
->
NotEquivalent
emptyModel
x
->
x
x
->
x
)
@?=
b
(
.==
)
=
testEquiv
Equivalent
(
.!=
)
=
testEquiv
$
NotEquivalent
emptyModel
...
...
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