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:
		
							parent
							
								
									776a973d2c
								
							
						
					
					
						commit
						2d6b2008f5
					
				
							
								
								
									
										15
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								Makefile
									
									
									
									
									
								
							| @ -352,10 +352,20 @@ tools/generatejournal: tools/generatejournal.hs | |||||||
| ######################################################################
 | ######################################################################
 | ||||||
| # TESTING
 | # TESTING
 | ||||||
| 
 | 
 | ||||||
| 
 | # developer environment checks
 | ||||||
| ######################################################################
 | ######################################################################
 | ||||||
| # DOCUMENTATION
 | # 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
 | # RELEASING
 | ||||||
| @ -365,9 +375,6 @@ tools/generatejournal: tools/generatejournal.hs | |||||||
| # set-up-rc-repo:
 | # set-up-rc-repo:
 | ||||||
| # 	cd site/_site; ln -s ../download
 | # 	cd site/_site; ln -s ../download
 | ||||||
| 
 | 
 | ||||||
| checkdeps packdeps: |  | ||||||
| 	for p in $(PACKAGES); do packdeps $$p/$$p.cabal; done |  | ||||||
| 
 |  | ||||||
| ######################################################################
 | ######################################################################
 | ||||||
| # MISCELLANEOUS
 | # MISCELLANEOUS
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										5
									
								
								checks/10-cabal-installed.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								checks/10-cabal-installed.test
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | |||||||
|  | # cabal 1.20 or greater | ||||||
|  | cabal --version | ||||||
|  | >>> /cabal-install version (1\.(2[0-9]|[3-9])|[2-9])/ | ||||||
|  | >>>= 0 | ||||||
|  | 
 | ||||||
							
								
								
									
										4
									
								
								checks/10-ghc-installed.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								checks/10-ghc-installed.test
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,4 @@ | |||||||
|  | # GHC 7.4 or greater | ||||||
|  | ghc --version | ||||||
|  | >>> /7.(4|6|8|[12][0-9])/ | ||||||
|  | >>>= 0 | ||||||
							
								
								
									
										4
									
								
								checks/20-ghc-pkg-check.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								checks/20-ghc-pkg-check.test
									
									
									
									
									
										Normal 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 | ||||||
							
								
								
									
										5
									
								
								checks/31-hledger-lib-cabal-deps-installed.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								checks/31-hledger-lib-cabal-deps-installed.test
									
									
									
									
									
										Normal 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 | ||||||
							
								
								
									
										5
									
								
								checks/32-hledger-cli-cabal-deps-installed.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								checks/32-hledger-cli-cabal-deps-installed.test
									
									
									
									
									
										Normal 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 | ||||||
							
								
								
									
										5
									
								
								checks/33-hledger-web-cabal-deps-installed.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								checks/33-hledger-web-cabal-deps-installed.test
									
									
									
									
									
										Normal 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 | ||||||
							
								
								
									
										5
									
								
								checks/41-hledger-lib-cabal-repl.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								checks/41-hledger-lib-cabal-repl.test
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | |||||||
|  | # cabal repl works for hledger-lib | ||||||
|  | echo :q | make repl-lib | tail | ||||||
|  | >>> /Ok, modules loaded: Hledger, / | ||||||
|  | >>>2 | ||||||
|  | >>>= 0 | ||||||
							
								
								
									
										5
									
								
								checks/42-hledger-cli-cabal-repl.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								checks/42-hledger-cli-cabal-repl.test
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | |||||||
|  | # cabal repl works for hledger | ||||||
|  | echo :q | make repl | tail | ||||||
|  | >>> /Ok, modules loaded: Hledger.Cli, / | ||||||
|  | >>>2 | ||||||
|  | >>>= 0 | ||||||
							
								
								
									
										5
									
								
								checks/43-hledger-web-cabal-repl.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								checks/43-hledger-web-cabal-repl.test
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										4
									
								
								checks/51-make-ghci.test
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,4 @@ | |||||||
|  | # hledger+hledger-lib GHCI prompt works | ||||||
|  | echo :q | make ghci | tail | ||||||
|  | >>> /Ok, modules loaded: Hledger, / | ||||||
|  | >>>= 0 | ||||||
							
								
								
									
										4
									
								
								checks/52-make-ghci-web.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								checks/52-make-ghci-web.test
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										1
									
								
								checks/README
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | |||||||
|  | Shell tests which aim to help developers maintain a working environment. | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user