tools: "make check" tests the dev environment

Fed up with GHC/cabal constantly assaulting me like Cato in a Pink
Panther movie, here are some shell tests to give me some
warning/reassurance about the dev setup on various machines.
Thou Shalt Not Reimplement Autoconf, but perhaps a little cross-platform
test suite focussed on my needs is a reasonable idea.
This commit is contained in:
Simon Michael 2014-08-13 15:44:11 -07:00
parent 776a973d2c
commit 2d6b2008f5
13 changed files with 63 additions and 4 deletions

View File

@ -352,10 +352,20 @@ tools/generatejournal: tools/generatejournal.hs
######################################################################
# TESTING
# developer environment checks
######################################################################
# DOCUMENTATION
check:
@echo sanity-check developer environment:
@($(SHELLTEST) checks -- --threads=8 \
&& echo $@ PASSED) || echo $@ FAILED
# run packdeps on each package to check for disallowed newer dependencies
packdeps:
for p in $(PACKAGES); do packdeps $$p/$$p.cabal; done
######################################################################
# RELEASING
@ -365,9 +375,6 @@ tools/generatejournal: tools/generatejournal.hs
# set-up-rc-repo:
# cd site/_site; ln -s ../download
checkdeps packdeps:
for p in $(PACKAGES); do packdeps $$p/$$p.cabal; done
######################################################################
# MISCELLANEOUS

View File

@ -0,0 +1,5 @@
# cabal 1.20 or greater
cabal --version
>>> /cabal-install version (1\.(2[0-9]|[3-9])|[2-9])/
>>>= 0

View File

@ -0,0 +1,4 @@
# GHC 7.4 or greater
ghc --version
>>> /7.(4|6|8|[12][0-9])/
>>>= 0

View File

@ -0,0 +1,4 @@
# ghc-pkg check (or the sandbox equivalent) reports no errors
[[ -e cabal.sandbox.config ]] && cabal sandbox hc-pkg check || ghc-pkg check
>>>2 !/(There are problems|The following packages are broken)/
>>>= 0

View File

@ -0,0 +1,5 @@
# hledger-lib's cabal dependencies are installed
cabal install ./hledger-lib --only-dep --dry || echo HINT: cabal install ./hledger-lib --only-dep
>>> /All the requested packages are already installed/
>>>2
>>>= 0

View File

@ -0,0 +1,5 @@
# hledger's cabal dependencies are installed
cabal install ./hledger --only-dep --dry || echo HINT: cabal install ./hledger-lib
>>> /All the requested packages are already installed/
>>>2
>>>= 0

View File

@ -0,0 +1,5 @@
# hledger-lib's cabal dependencies are installed
cabal install ./hledger-web --only-dep --dry || echo HINT: cabal install ./hledger
>>> /All the requested packages are already installed/
>>>2
>>>= 0

View File

@ -0,0 +1,5 @@
# cabal repl works for hledger-lib
echo :q | make repl-lib | tail
>>> /Ok, modules loaded: Hledger, /
>>>2
>>>= 0

View File

@ -0,0 +1,5 @@
# cabal repl works for hledger
echo :q | make repl | tail
>>> /Ok, modules loaded: Hledger.Cli, /
>>>2
>>>= 0

View File

@ -0,0 +1,5 @@
# cabal repl works for hledger-web
echo :q | make repl-web | tail
>>> /Ok, modules loaded: Settings, Main, Hledger.Web.Main, /
>>>2
>>>= 0

4
checks/51-make-ghci.test Normal file
View File

@ -0,0 +1,4 @@
# hledger+hledger-lib GHCI prompt works
echo :q | make ghci | tail
>>> /Ok, modules loaded: Hledger, /
>>>= 0

View File

@ -0,0 +1,4 @@
# hledger-web+hledger+hledger-lib GHCI prompt works
echo :q | make ghciweb | tail
>>> /Ok, modules loaded: Settings, Main, /
>>>= 0

1
checks/README Normal file
View File

@ -0,0 +1 @@
Shell tests which aim to help developers maintain a working environment.