Skip to content
Snippets Groups Projects
Commit 1b4f509b authored by Oleg Grenrus's avatar Oleg Grenrus
Browse files

Run doctest as part of validate.sh

parent 70d22dde
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -3,6 +3,8 @@
cabal.project.local
.ghc.environment.*
.docker/
**/.hpc
**/*.hi
**/*.o
......
......@@ -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:dDv' 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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment