Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Haskell
Cabal
Commits
1b4f509b
Commit
1b4f509b
authored
5 years ago
by
Oleg Grenrus
Browse files
Options
Downloads
Patches
Plain Diff
Run doctest as part of validate.sh
parent
70d22dde
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.docker/validate-8.8.1.dockerfile
+2
-1
2 additions, 1 deletion
.docker/validate-8.8.1.dockerfile
.dockerignore
+2
-0
2 additions, 0 deletions
.dockerignore
validate.sh
+22
-2
22 additions, 2 deletions
validate.sh
with
26 additions
and
3 deletions
.docker/validate-8.8.1.dockerfile
+
2
−
1
View file @
1b4f509b
...
...
@@ -6,6 +6,7 @@ RUN cabal v2-install cabal-plan --constraint 'cabal-plan ^>=0.6'
# We install happy, so it's in the store; we (hopefully) don't use it directly.
RUN
cabal v2-install happy
--constraint
'happy ^>=1.19.12'
RUN
cabal v2-install doctest
--constraint
'doctest ^>= 0.16.2'
# Install some other dependencies
# Remove $HOME/.ghc so there aren't any environments
...
...
@@ -41,4 +42,4 @@ RUN cabal v2-install -w ghc-8.8.1 --lib \
# Validate
WORKDIR
/build
COPY
. /build
RUN
sh ./validate.sh
-w
ghc-8.8.1
-v
RUN
sh ./validate.sh
-w
ghc-8.8.1
-v
-D
This diff is collapsed.
Click to expand it.
.dockerignore
+
2
−
0
View file @
1b4f509b
...
...
@@ -3,6 +3,8 @@
cabal.project.local
.ghc.environment.*
.docker/
**/.hpc
**/*.hi
**/*.o
...
...
This diff is collapsed.
Click to expand it.
validate.sh
+
22
−
2
View file @
1b4f509b
...
...
@@ -13,6 +13,7 @@ CABALINSTALLTESTS=true
CABALSUITETESTS
=
true
CABALONLY
=
false
DEPSONLY
=
false
DOCTEST
=
false
VERBOSE
=
false
# Help
...
...
@@ -22,7 +23,7 @@ show_usage() {
cat
<<
EOF
./validate.sh - build & test
Usage: ./validate.sh [ -j JOBS | -l | -C | -c | -s | -w HC | -x CABAL | -y CABALPLAN | -d | -v ]
Usage: ./validate.sh [ -j JOBS | -l | -C | -c | -s | -w HC | -x CABAL | -y CABALPLAN | -d |
-D |
-v ]
A script which runs all the tests.
Available options:
...
...
@@ -35,6 +36,7 @@ Available options:
-x CABAL With cabal-install
-y CABALPLAN With cabal-plan
-d Build dependencies only
-D Run doctest
-v Verbose
EOF
exit
0
...
...
@@ -110,7 +112,7 @@ footer() {
# getopt
#######################################################################
while
getopts
'j:lCcsw:x:y:dv'
flag
;
do
while
getopts
'j:lCcsw:x:y:d
D
v'
flag
;
do
case
$flag
in
j
)
JOBS
=
"
$OPTARG
"
;;
...
...
@@ -130,6 +132,8 @@ while getopts 'j:lCcsw:x:y:dv' flag; do
;;
d
)
DEPSONLY
=
true
;;
D
)
DOCTEST
=
true
;;
v
)
VERBOSE
=
true
;;
?
)
show_usage
...
...
@@ -165,6 +169,7 @@ cabal-install tests: $CABALINSTALLTESTS
cabal-testsuite:
$CABALSUITETESTS
library only:
$CABALONLY
dependencies only:
$DEPSONLY
doctest:
$DOCTEST
verbose:
$VERBOSE
EOF
...
...
@@ -237,6 +242,21 @@ timed $CABALNEWBUILD Cabal:lib:Cabal --enable-tests --disable-benchmarks --dry-r
timed
$CABALNEWBUILD
Cabal:lib:Cabal
--enable-tests
--disable-benchmarks
--dep
||
exit
1
timed
$CABALNEWBUILD
Cabal:lib:Cabal
--enable-tests
--disable-benchmarks
||
exit
1
if
$DOCTEST
;
then
if
command
-v
doctest
>
/dev/null
;
then
echo
"
$CYAN
=== Cabal: doctest =====================================
$(
date
+%T
)
===
$RESET
"
timed
$CABALNEWBUILD
Cabal:lib:Cabal
--enable-tests
--disable-benchmarks
--write-ghc-environment-files
=
always
||
exit
1
timed doctest
--fast
Cabal/Distribution Cabal/Language
timed
rm
-f
.ghc.environment.
*
else
echo
"No doctest command found"
fi
# command -v doctest
fi
# DOCTEST
if
$CABALTESTS
;
then
echo
"
$CYAN
=== Cabal: test ========================================
$(
date
+%T
)
===
$RESET
"
...
...
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