Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-orbit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Katerina Roukounaki
cloud-orbit
Commits
d3f1cfdf
Commit
d3f1cfdf
authored
Nov 18, 2014
by
Yiannis Tsiouris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Test.Framework with HUnit for tests
parent
a94c0e8b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
8 deletions
+20
-8
.gitignore
.gitignore
+2
-0
Makefile
Makefile
+5
-1
Tests.hs
Tests.hs
+13
-7
No files found.
.gitignore
View file @
d3f1cfdf
...
@@ -2,3 +2,5 @@
...
@@ -2,3 +2,5 @@
*~
*~
*.o
*.o
*.hi
*.hi
orbit
OrbitTests
Makefile
View file @
d3f1cfdf
...
@@ -3,8 +3,12 @@
...
@@ -3,8 +3,12 @@
orbit
:
FORCE
orbit
:
FORCE
ghc
--make
Bench.hs
-o
orbit
ghc
--make
Bench.hs
-o
orbit
tests
:
orbit
ghc
-package
test-framework
-package
test-framework-hunit
\
-threaded
Tests.hs
-o
OrbitTests
clean
:
clean
:
$(RM)
*
.swp
*
~
*
.hi
*
.o
$(RM)
*
.swp
*
~
*
.hi
*
.o
distclean
:
clean
distclean
:
clean
$(RM)
orbit
$(RM)
orbit
OrbitTests
Tests.hs
View file @
d3f1cfdf
import
Test.HUnit
import
Test.HUnit
import
Test.Framework
(
defaultMain
,
testGroup
)
import
Test.Framework.Providers.HUnit
import
Bench
(
seq
,
g13
,
g124
,
g1245
)
import
Bench
(
seq
,
g13
,
g124
,
g1245
)
test1
=
TestCase
(
assertEqual
"g13 11"
"{size,10}"
(
Bench
.
seq
g13
11
))
main
=
defaultMain
tests
test2
=
TestCase
(
assertEqual
"g124 157"
"{size,133}"
(
Bench
.
seq
g124
157
))
test3
=
TestCase
(
assertEqual
"g1245 157"
"{size,134}"
(
Bench
.
seq
g1245
157
))
tests
=
TestList
[
TestLabel
"seq short"
test1
tests
=
[
testGroup
"Sequential tests"
[
,
TestLabel
"seq medium"
test2
testCase
"short"
test1
,
,
TestLabel
"seq long"
test3
testCase
"intermediate"
test2
,
]
testCase
"long"
test3
]
]
test1
=
assertEqual
"g13 11"
"{size,10}"
(
Bench
.
seq
g13
11
)
test2
=
assertEqual
"g124 157"
"{size,133}"
(
Bench
.
seq
g124
157
)
test3
=
assertEqual
"g1245 157"
"{size,134}"
(
Bench
.
seq
g1245
157
)
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