Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
1cff0d4e
Commit
1cff0d4e
authored
Oct 28, 2013
by
Adam Vogt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add doctest runner
parent
f159fca4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
IHaskell.cabal
IHaskell.cabal
+7
-0
rundoctests.hs
rundoctests.hs
+37
-0
No files found.
IHaskell.cabal
View file @
1cff0d4e
...
...
@@ -89,3 +89,10 @@ executable IHaskell
here,
system-filepath,
text ==0.11.*
Test-Suite doctests
Type: exitcode-stdio-1.0
Ghc-Options: -threaded
Main-Is: rundoctests.hs
Build-Depends: base, doctest >= 0.8, process
rundoctests.hs
0 → 100644
View file @
1cff0d4e
import
System.Process
import
System.Exit
import
System.IO
import
Test.DocTest
import
Data.Char
import
System.Environment
-- | tests that all the >>> comments are followed by correct output. Easiest is to
--
-- > cabal test
--
-- or
--
-- > runghc examples/rundoctests.hs
--
-- or
--
-- > runghc examples/rundoctests.hs Data/HList/File1.hs Data/HList/File2.hs
--
-- you need Cabal >= 1.18 since that's around when cabal repl got added.
main
=
do
as
<-
getArgs
o
<-
readProcess
"cabal"
[
"repl"
,
"--ghc-options"
,
"-v0 -w"
]
":show packages
\n
:show language"
let
flags
=
words
$
unlines
$
filter
((
==
"-"
)
.
take
1
.
dropWhile
isSpace
)
$
lines
o
let
files
=
case
as
of
[]
->
[
"Main.hs"
]
_
->
as
doctest
$
"-i."
:
"-idist/build/autogen"
:
"-optP-include"
:
"-optPdist/build/autogen/cabal_macros.h"
:
"-Idist/build/autogen"
:
"-w"
:
files
++
flags
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