summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-02-27 15:35:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-02-27 15:38:21 -0400
commit38f9605143c5fc80f0948ec4e579a6b4598e70dd (patch)
tree1f93e7d42edcafc08e8fbc928fe7f6bcf1deb092 /Makefile
parent52573c7b8cd253c43e92decce6cded80d8eca8f3 (diff)
embed test suite into git annex; available by running: git annex test
I have seen some other programs do this, and think it's pretty cool. Means you can test wherever it's deployed, as well as at build time. My other reason for doing it is less happy. Cabal's handling of test suites sucks, requiring duplicated info, and even when that's done, it fails to preprocess hsc files here. Building it in avoids that and avoids having to explicitly tell cabal to enable test suites, which would then make it link the test executable every time, which is unnecessarily slow. This also has the benefit that now "make fast test" does a max speed build and tests it.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 4 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index 4f5b526ef..3835436b2 100644
--- a/Makefile
+++ b/Makefile
@@ -47,22 +47,8 @@ install: build-stamp install-docs
ln -sf git-annex $(DESTDIR)$(PREFIX)/bin/git-annex-shell
runghc Build/InstallDesktopFile.hs $(PREFIX)/bin/git-annex || true
-test:
-# workaround for, apparently, a cabal bug
- hsc2hs Utility/Touch.hsc
- cabal configure --enable-tests
- cabal build
- rm -f Utility/Touch.hs
- cabal test
-
-testcoverage:
- rm -f test.tix test
- $(GHC) $(GHCFLAGS) -outputdir tmp/testcoverage --make -fhpc test
- ./test
- @echo ""
- @hpc report test --exclude=Main --exclude=QC
- @hpc markup test --exclude=Main --exclude=QC --destdir=.hpc >/dev/null
- @echo "(See .hpc/ for test coverage details.)"
+test: git-annex
+ ./git-annex test
# hothasktags chokes on some tempolate haskell etc, so ignore errors
tags:
@@ -86,7 +72,7 @@ docs: $(mans)
--exclude='bugs/*' --exclude='todo/*' --exclude='forum/*'
clean:
- rm -rf tmp dist git-annex $(mans) test configure *.tix .hpc \
+ rm -rf tmp dist git-annex $(mans) configure *.tix .hpc \
doc/.ikiwiki html dist build-stamp tags Build/SysConfig.hs
sdist: clean $(mans)
@@ -175,4 +161,4 @@ androidapp:
$(MAKE) -C standalone/android
cp standalone/android/source/term/bin/Term-debug.apk tmp/git-annex.apk
-.PHONY: git-annex test install tags
+.PHONY: git-annex install tags