Support building with tasty-1.3

This commit was sponsored by Ethan Aubin.
This commit is contained in:
Joey Hess 2020-05-21 15:26:32 -04:00
parent df5d72c88b
commit 27459c6e3f
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 18 additions and 2 deletions

View file

@ -31,6 +31,7 @@ git-annex (8.20200502) UNRELEASED; urgency=medium
* Fix bug that made enableremote of S3 and webdav remotes, that
have embedcreds=yes, fail to set up the embedded creds, so accessing
the remotes failed. (Regression introduced in version 7.20200202.7)
* Support building with tasty-1.3.
-- Joey Hess <id@joeyh.name> Mon, 04 May 2020 12:46:11 -0400

18
Test.hs
View file

@ -1,6 +1,6 @@
{- git-annex test suite
-
- Copyright 2010-2019 Joey Hess <id@joeyh.name>
- Copyright 2010-2020 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU AGPL version 3 or higher.
-}
@ -19,6 +19,7 @@ import Test.Tasty.Runners
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import Test.Tasty.Ingredients.Rerun
import Test.Tasty.Options
import Options.Applicative (switch, long, help, internal)
import qualified Data.Map as M
@ -96,7 +97,7 @@ import qualified Types.Remote
optParser :: Parser TestOptions
optParser = TestOptions
<$> suiteOptionParser ingredients (tests False True mempty)
<$> snd tastyParser
<*> switch
( long "keep-failures"
<> help "preserve repositories on test failure"
@ -107,6 +108,15 @@ optParser = TestOptions
)
<*> cmdParams "non-options are for internal use only"
tastyParser :: ([String], Parser Test.Tasty.Options.OptionSet)
#if MIN_VERSION_tasty(1,3,0)
tastyParser = go
#else
tastyParser = ([], go)
#endif
where
go = suiteOptionParser ingredients (tests False True mempty)
runner :: TestOptions -> IO ()
runner opts
| fakeSsh opts = runFakeSsh (internalData opts)
@ -118,6 +128,10 @@ runner opts
-- suite.
subenv = "GIT_ANNEX_TEST_SUBPROCESS"
runsubprocesstests Nothing = do
let warnings = fst tastyParser
unless (null warnings) $ do
hPutStrLn stderr "warnings from tasty:"
mapM_ (hPutStrLn stderr) warnings
pp <- Annex.Path.programPath
Utility.Env.Set.setEnv subenv "1" True
ps <- getArgs

View file

@ -146,3 +146,4 @@ Build git-annex with tasty-1.3
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
Yes.
> [[fixed|done]] --[[Joey]]