optParser :: Parser TestOptions
optParser = TestOptions
- <$> snd (tastyParser (tests False True mempty))
+ <$> snd (tastyParser (tests 1 False True mempty))
<*> switch
( long "keep-failures"
<> help "preserve repositories on test failure"
runner :: TestOptions -> IO ()
runner opts = parallelTestRunner opts tests
-tests :: Bool -> Bool -> TestOptions -> [TestTree]
-tests crippledfilesystem adjustedbranchok opts =
+tests :: Int -> Bool -> Bool -> TestOptions -> [TestTree]
+tests n crippledfilesystem adjustedbranchok opts =
properties
: withTestMode remotetestmode Nothing testRemotes
- : map (\(d, te) -> withTestMode te (Just initTests) (unitTests d)) testmodes
+ : concatMap mkunittests testmodes
where
testmodes = catMaybes
[ canadjust ("v8 adjusted unlocked branch", (testMode opts (RepoVersion 8)) { adjustedUnlockedBranch = True })
canadjust v
| adjustedbranchok = Just v
| otherwise = Nothing
+ mkunittests (d, te) = map
+ (\uts -> withTestMode te (Just initTests) uts)
+ (unitTests d n)
properties :: TestTree
properties = localOption (QuickCheckTests 1000) $ testGroup "QuickCheck" $
, testCase "add" test_add
]
-unitTests :: String -> TestTree
-unitTests note = testGroup ("Unit Tests " ++ note)
+unitTests :: String -> Int -> [TestTree]
+unitTests note numparts = map (testGroup ("Unit Tests " ++ note)) $ sep
[ testCase "add dup" test_add_dup
, testCase "add extras" test_add_extras
, testCase "readonly remote" test_readonly_remote
, testCase "add subdirs" test_add_subdirs
, testCase "addurl" test_addurl
]
+ where
+ sep = sep' (replicate numparts [])
+ sep' (p:ps) (l:ls) = sep' (ps++[l:p]) ls
+ sep' ps [] = ps
+ sep' [] _ = []
-- this test case creates the main repo
test_init :: Assertion
- leave open are closed before finalCleanup is run at the end. This
- prevents some failures to clean up after the test suite.
-}
-parallelTestRunner :: TestOptions -> (Bool -> Bool -> TestOptions -> [TestTree]) -> IO ()
+parallelTestRunner :: TestOptions -> (Int -> Bool -> Bool -> TestOptions -> [TestTree]) -> IO ()
parallelTestRunner opts mkts
| fakeSsh opts = runFakeSsh (internalData opts)
| otherwise = go =<< Utility.Env.getEnv subenv
where
+ numparts = 1
subenv = "GIT_ANNEX_TEST_SUBPROCESS"
go Nothing = do
ensuredir tmpdir
(toRawFilePath tmpdir)
Nothing Nothing False
adjustedbranchok <- Annex.AdjustedBranch.isGitVersionSupported
- let ts = mkts crippledfilesystem adjustedbranchok opts
+ let ts = mkts numparts crippledfilesystem adjustedbranchok opts
let warnings = fst (tastyParser ts)
unless (null warnings) $ do
hPutStrLn stderr "warnings from tasty:"
go (Just subenvval) = case readish subenvval of
Nothing -> error ("Bad " ++ subenv)
Just (n, crippledfilesystem, adjustedbranchok) -> isolateGitConfig $ do
- let ts = mkts crippledfilesystem adjustedbranchok opts
+ let ts = mkts numparts crippledfilesystem adjustedbranchok opts
let t = topLevelTestGroup
-- This group is needed to avoid what
-- seems to be a tasty bug which causes a