From 188862a08c0a5b815991a977226aaab9408caf10 Mon Sep 17 00:00:00 2001 From: Fendor Date: Fri, 4 Jun 2021 18:57:53 +0200 Subject: [PATCH] Extend s-b-i information in Cabal --- .../src/Distribution/Simple/ShowBuildInfo.hs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Cabal/src/Distribution/Simple/ShowBuildInfo.hs b/Cabal/src/Distribution/Simple/ShowBuildInfo.hs index 0ea6f96a7b9..89e7d61d2f1 100644 --- a/Cabal/src/Distribution/Simple/ShowBuildInfo.hs +++ b/Cabal/src/Distribution/Simple/ShowBuildInfo.hs @@ -148,11 +148,26 @@ mkComponentInfo wdir pkg_descr lbi clbi = JsonObject $ modules = case comp of CLib lib -> explicitLibModules lib CExe exe -> exeModules exe - _ -> [] + CTest test -> + case testInterface test of + TestSuiteExeV10 _ _ -> [] + TestSuiteLibV09 _ modName -> [modName] + TestSuiteUnsupported _ -> [] + CBench bench -> benchmarkModules bench + CFLib flib -> foreignLibModules flib sourceFiles = case comp of CLib _ -> [] CExe exe -> [modulePath exe] - _ -> [] + CTest test -> + case testInterface test of + TestSuiteExeV10 _ fp -> [fp] + TestSuiteLibV09 _ _ -> [] + TestSuiteUnsupported _ -> [] + CBench bench -> case benchmarkInterface bench of + BenchmarkExeV10 _ fp -> [fp] + BenchmarkUnsupported _ -> [] + + CFLib _ -> [] cabalFile | Just fp <- pkgDescrFile lbi = [("cabal-file", JsonString (T.pack fp))] | otherwise = []