From feb5470c0b791d2b726614f49ba7bd290069f8cd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 27 Feb 2013 15:59:31 -0400 Subject: [PATCH] disable test suite on Android Cannot get QuickCheck to install just now. --- GitAnnex.hs | 4 ++++ Makefile | 2 +- git-annex.cabal | 9 ++++++++- git-annex.hs | 8 ++++++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/GitAnnex.hs b/GitAnnex.hs index 278a66358e..17bd759873 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 6883914c4d..d714f2eb96 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 3aad55e1a8..7d370d34fc 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 e2cd80ace8..a2ddb00325 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