summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-02-27 15:59:31 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-02-27 15:59:31 -0400
commit5f411d144c343924849c93b203b393a33e395ce9 (patch)
treeaf657accecdc995cc856f6674f87affa87a65dd2
parent58237dbf4738dd48e197edcd092a2db055d926d8 (diff)
disable test suite on Android
Cannot get QuickCheck to install just now.
-rw-r--r--GitAnnex.hs4
-rw-r--r--Makefile2
-rw-r--r--git-annex.cabal9
-rw-r--r--git-annex.hs8
4 files changed, 21 insertions, 2 deletions
diff --git a/GitAnnex.hs b/GitAnnex.hs
index 278a66358..17bd75987 100644
--- a/GitAnnex.hs
+++ b/GitAnnex.hs
@@ -77,7 +77,9 @@ import qualified Command.WebApp
import qualified Command.XMPPGit
#endif
#endif
+#ifdef WITH_TESTUITE
import qualified Command.Test
+#endif
cmds :: [Command]
cmds = concat
@@ -136,7 +138,9 @@ cmds = concat
, Command.XMPPGit.def
#endif
#endif
+#ifdef WITH_TESTUITE
, Command.Test.def
+#endif
]
options :: [Option]
diff --git a/Makefile b/Makefile
index 6883914c4..d714f2eb9 100644
--- a/Makefile
+++ b/Makefile
@@ -152,7 +152,7 @@ android:
cabal configure
# cabal cannot cross compile with custom build type, so workaround
sed -i 's/Build-type: Custom/Build-type: Simple/' git-annex.cabal
- $$HOME/.ghc/android-14/arm-linux-androideabi-4.7/arm-linux-androideabi/bin/cabal configure -f'Android Assistant -Pairing -Webapp'
+ $$HOME/.ghc/android-14/arm-linux-androideabi-4.7/arm-linux-androideabi/bin/cabal configure -f'Android Assistant -Pairing -Webapp -TestSuite'
$(MAKE) git-annex
sed -i 's/Build-type: Simple/Build-type: Custom/' git-annex.cabal
diff --git a/git-annex.cabal b/git-annex.cabal
index 3aad55e1a..7d370d34f 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -59,11 +59,14 @@ Flag Android
Description: Building for Android
Default: False
+Flag TestSuite
+ Description: Embed the test suite into git-annex
+
Executable git-annex
Main-Is: git-annex.hs
Build-Depends: MissingH, hslogger, directory, filepath,
unix, containers, utf8-string, network (>= 2.0), mtl (>= 2.1.1),
- bytestring, old-locale, time, testpack, HUnit,
+ bytestring, old-locale, time,
extensible-exceptions, dataenc, SHA, process, json,
base (>= 4.5 && < 4.8), monad-control, transformers-base, lifted-base,
IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance, process,
@@ -78,6 +81,10 @@ Executable git-annex
if flag(Production)
GHC-Options: -O2
+ if flag(TestSuite)
+ Build-Depends: testpack, HUnit
+ CPP-Options: -DWITH_TESTSUITE
+
if flag(S3)
Build-Depends: hS3
CPP-Options: -DWITH_S3
diff --git a/git-annex.hs b/git-annex.hs
index e2cd80ace..a2ddb0032 100644
--- a/git-annex.hs
+++ b/git-annex.hs
@@ -5,12 +5,16 @@
- Licensed under the GNU GPL version 3 or higher.
-}
+{-# LANGUAGE CPP #-}
+
import System.Environment
import System.FilePath
import qualified GitAnnex
import qualified GitAnnexShell
+#ifdef WITH_TESTUITE
import qualified Test
+#endif
main :: IO ()
main = run =<< getProgName
@@ -21,6 +25,10 @@ main = run =<< getProgName
isshell n = takeFileName n == "git-annex-shell"
go a = do
ps <- getArgs
+#ifdef WITH_TESTUITE
if ps == ["test"]
then Test.main
else a ps
+#else
+ a ps
+#endif