diff options
| author | Daniel Gröber <dxld@darkboxed.org> | 2019-07-30 16:37:20 +0200 | 
|---|---|---|
| committer | Daniel Gröber (dxld) <dxld@darkboxed.org> | 2019-09-17 17:48:26 +0200 | 
| commit | 99140dbf830caac283385389e383b816a0946462 (patch) | |
| tree | fa544c9b14ef07193401351cfa4698824859e6fb | |
| parent | 6b847c923ec62d18e99a30858efc3506cee32dca (diff) | |
ghc-session: Output test specs of tests being run
The strings under the "Going to Run These Tests" heading can be plugged
right back into the commandline to run just that test.
| -rw-r--r-- | tests/GhcSession.hs | 20 | 
1 files changed, 18 insertions, 2 deletions
| diff --git a/tests/GhcSession.hs b/tests/GhcSession.hs index 6816e02..78a819e 100644 --- a/tests/GhcSession.hs +++ b/tests/GhcSession.hs @@ -109,6 +109,9 @@ main = do    let showEsrVer = either (\(SkipReason msg) -> "dunno, "++msg) showVersion +  putStrLn "Environment Info" +  putStrLn "================" +  putStrLn ""    putStrLn $ "cabal-install version: " ++ showVersion ci_ver    putStrLn $ "cabal-install builtin Cabal version: "               ++ showEsrVer (f_c_ver V1) @@ -116,16 +119,20 @@ main = do    putStrLn $ "GHC library version: " ++ cProjectVersion    putStrLn $ "Stack version: " ++ showVersion s_ver    putStrLn $ "Stack Cabal version: " ++ showEsrVer (f_c_ver Stack) +  putStrLn ""    when (cProjectVersion /= showVersion g_ver) $      error "GHC version mismatch! See above."    let proj_impls :: [(ProjType, ProjSetup0)]        proj_impls = +        -- V2 is sorted before the others here so helper compilation always +        -- uses v2-build caching!          [ (V2,    newBuildProjSetup)          , (V1,    oldBuildProjSetup)          , (Stack, stackProjSetup g_ver)          ] +      all_proj_types = map fst proj_impls    tests <- return $ case args of      xs@(_:_) -> flip map xs $ \loc -> @@ -149,8 +156,15 @@ main = do        --            min Cabal lib ver -^    min GHC ver -^        ] +  putStrLn "Going to Run These Tests" +  putStrLn "========================" +  forM_ tests $ \(TC loc _ _ pts) -> do +    let (topdir, projdir, cabal_file) = testLocPath loc +    forM_ (if pts == [] then all_proj_types else pts)  $ \pt -> putStrLn $ +      "- " ++ intercalate ":" [topdir, projdir, cabal_file, show pt] +    pPrint tests -  mapM_ (\(TC loc _ _ _) -> pPrint $ testLocPath loc) tests +  putStrLn ""    res :: [[TestResult]] <- sequence $ do      tc@TC {..} <- tests @@ -176,7 +190,9 @@ main = do            Left reason -> return $ skip reason >> return []            Right (Message msg, act) -> return $ putStrLn msg >> act -  putStr "\n\n\n\nRan Tests\n=========\n" +  putStr "\n\n\n\n" +  putStrLn "Test Results" +  putStrLn "============"    pPrint res    if any (==False) $ map trSuccess $ concat res | 
