Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
5d457a31
Commit
5d457a31
authored
Jan 19, 2011
by
ttuegel
Browse files
Including test suites in product of 'setup sdist'.
See ticket #792.
parent
cbe50672
Changes
1
Hide whitespace changes
Inline
Side-by-side
Distribution/Simple/SrcDist.hs
View file @
5d457a31
...
...
@@ -67,7 +67,8 @@ module Distribution.Simple.SrcDist (
)
where
import
Distribution.PackageDescription
(
PackageDescription
(
..
),
BuildInfo
(
..
),
Executable
(
..
),
Library
(
..
)
)
(
PackageDescription
(
..
),
BuildInfo
(
..
),
Executable
(
..
),
Library
(
..
)
,
TestSuite
(
..
),
TestSuiteInterface
(
..
)
)
import
Distribution.PackageDescription.Check
(
PackageCheck
(
..
),
checkConfiguredPackage
,
checkPackageFiles
)
import
Distribution.Package
...
...
@@ -164,6 +165,24 @@ prepareTree verbosity pkg_descr0 mb_lbi distPref tmpDir pps = do
Nothing
->
findFile
(
hsSourceDirs
exeBi
)
mainPath
Just
pp
->
return
pp
copyFileTo
verbosity
targetDir
srcMainFile
-- move the test suites into place
withTest
$
\
t
->
do
let
bi
=
testBuildInfo
t
prep
=
prepareDir
verbosity
pkg_descr
distPref
targetDir
pps
case
testInterface
t
of
TestSuiteExeV10
_
mainPath
->
do
prep
[]
bi
srcMainFile
<-
do
ppFile
<-
findFileWithExtension
(
ppSuffixes
pps
)
(
hsSourceDirs
bi
)
(
dropExtension
mainPath
)
case
ppFile
of
Nothing
->
findFile
(
hsSourceDirs
bi
)
mainPath
Just
pp
->
return
pp
copyFileTo
verbosity
targetDir
srcMainFile
TestSuiteLibV09
_
m
->
do
prep
[
m
]
bi
TestSuiteUnsupported
tp
->
die
$
"Unsupported test suite type: "
++
show
tp
flip
mapM_
(
dataFiles
pkg_descr
)
$
\
filename
->
do
files
<-
matchFileGlob
(
dataDir
pkg_descr
</>
filename
)
let
dir
=
takeDirectory
(
dataDir
pkg_descr
</>
filename
)
...
...
@@ -229,6 +248,7 @@ prepareTree verbosity pkg_descr0 mb_lbi distPref tmpDir pps = do
-- versions of these functions that ignore the 'buildable' attribute:
withLib
action
=
maybe
(
return
()
)
action
(
library
pkg_descr
)
withExe
action
=
mapM_
action
(
executables
pkg_descr
)
withTest
action
=
mapM_
action
(
testSuites
pkg_descr
)
-- | Prepare a directory tree of source files for a snapshot version.
-- It is expected that the appropriate snapshot version has already been set
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment