Skip to content
Snippets Groups Projects
Verified Commit e8cc968f authored by Rodrigo Mesquita's avatar Rodrigo Mesquita :seedling:
Browse files

Location cabal-doctest

parent 6a986479
No related branches found
No related tags found
1 merge request!26Location migration
......@@ -15,7 +15,7 @@ index 30aeb12..5d01844 100644
, filepath
diff --git a/src/Distribution/Extra/Doctest.hs b/src/Distribution/Extra/Doctest.hs
index ac5d07d..8620cf0 100644
index ac5d07d..9224e9b 100644
--- a/src/Distribution/Extra/Doctest.hs
+++ b/src/Distribution/Extra/Doctest.hs
@@ -1,5 +1,11 @@
......@@ -78,7 +78,7 @@ index ac5d07d..8620cf0 100644
#if MIN_VERSION_Cabal(3,6,0)
import Distribution.Utils.Path
- (getSymbolicPath)
+ (getSymbolicPath, makeSymbolicPath)
+ (getSymbolicPath, makeSymbolicPath, makeRelativePathEx)
#endif
#if MIN_VERSION_directory(1,2,2)
......@@ -136,7 +136,7 @@ index ac5d07d..8620cf0 100644
+buildRules testSuiteName PreBuildComponentInputs{buildingWhat, localBuildInfo=lbi, targetInfo=tgt} = do
+ -- Generate the contents of the "Build_doctests" module inside the
+ -- test-suite whose name matches the provided test-suite name.
+ let autogendir = getSymbolicPath $ autogenComponentModulesDir lbi (targetCLBI tgt)
+ let autogendir = autogenComponentModulesDir lbi (targetCLBI tgt)
+ let action = mkCommand (static Dict) $ static (\(name, flags, lbi, autogendir) -> do
+ -- We re-use the generateBuildModule function, but
+ -- it could probably be simplified with the new
......@@ -144,7 +144,7 @@ index ac5d07d..8620cf0 100644
+ generateBuildModule name flags (localPkgDescr lbi) lbi
+ (Just autogendir))
+ registerRule_ ("doctest-" <> toShortText testSuiteName) $
+ staticRule (action (testSuiteName, buildingWhat, lbi, autogendir)) [] (NE.singleton (autogendir, "Build_doctests.hs"))
+ staticRule (action (testSuiteName, buildingWhat, lbi, getSymbolicPath autogendir)) [] (NE.singleton $ Location autogendir (makeRelativePathEx "Build_doctests.hs"))
+
-- | A default main with doctests:
--
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment