on master help sign in
Build docs before tests #315
commitcdd0a645fc8ab977d9019f08447523969aff9289 authorMichael Snoyman <michael@snoyman.com> dateThu 23 Oct 2014, 05:54 (12 years ago) parentbc33d74
1 file changed+11−8
Stackage/Test.hs+11−8
Stackage/Test.hs+11−8
@@ -134,14 +134,8 @@ runTestSuite cabalVersion settings testdir docdir bp (packageName, SelectedPacka
134134 createDirectoryIfMissing True cfd
135135 copyFile src dst
136136 getHandle AppendMode $ run "cabal" (addCabalArgs settings BSTest ["configure", "--enable-tests"]) dir
137− when spiHasTests $ do
138− getHandle AppendMode $ run "cabal" ["build"] dir
139− getHandle AppendMode $ run "cabal" (concat
140− [ ["test"]
141− , if cabalVersion >= CabalVersion 1 20
142− then ["--show-details=streaming"] -- FIXME temporary workaround for https://github.com/haskell/cabal/issues/1810
143− else []
144− ]) dir
137+
138+ -- Try building docs first in case tests have an expected failure.
145139 when (buildDocs settings) $ do
146140 getHandle AppendMode $ run "cabal"
147141 [ "haddock"
@@ -154,6 +148,15 @@ runTestSuite cabalVersion settings testdir docdir bp (packageName, SelectedPacka
154148 handle (\(_ :: IOException) -> return ()) $ renameDirectory
155149 (dir </> "dist" </> "doc" </> "html" </> packageName')
156150 (docdir </> package)
151+
152+ when spiHasTests $ do
153+ getHandle AppendMode $ run "cabal" ["build"] dir
154+ getHandle AppendMode $ run "cabal" (concat
155+ [ ["test"]
156+ , if cabalVersion >= CabalVersion 1 20
157+ then ["--show-details=streaming"] -- FIXME temporary workaround for https://github.com/haskell/cabal/issues/1810
158+ else []
159+ ]) dir
157160 return True
158161 let expectedFailure = packageName `Set.member` bpExpectedFailures bp
159162 if passed