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
aa1eed19
Commit
aa1eed19
authored
Apr 08, 2016
by
Mikhail Glushenkov
Browse files
Merge pull request #3301 from 23Skidoo/issue-3215
'cabal test': don't fail on no test suites.
parents
d90e338c
6a63a43a
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/Main.hs
View file @
aa1eed19
...
...
@@ -165,7 +165,7 @@ import Distribution.Version
import
qualified
Paths_cabal_install
(
version
)
import
System.Environment
(
getArgs
,
getProgName
)
import
System.Exit
(
exitFailure
)
import
System.Exit
(
exitFailure
,
exitSuccess
)
import
System.FilePath
(
dropExtension
,
splitExtension
,
takeExtension
,
(
</>
),
(
<.>
))
import
System.IO
(
BufferMode
(
LineBuffering
),
hSetBuffering
...
...
@@ -797,7 +797,7 @@ testAction (testFlags, buildFlags, buildExFlags) extraArgs globalFlags = do
testFlags'
=
testFlags
{
testDistPref
=
toFlag
distPref
}
-- The package was just configured, so the LBI must be available.
names
<-
componentNamesFromLBI
distPref
"test suites"
names
<-
componentNamesFromLBI
verbosity
distPref
"test suites"
(
\
c
->
case
c
of
{
LBI
.
CTest
{}
->
True
;
_
->
False
})
let
extraArgs'
|
null
extraArgs
=
case
names
of
...
...
@@ -816,9 +816,10 @@ data ComponentNames = ComponentNamesUnknown
|
ComponentNames
[
LBI
.
ComponentName
]
-- | Return the names of all buildable components matching a given predicate.
componentNamesFromLBI
::
FilePath
->
String
->
(
LBI
.
Component
->
Bool
)
componentNamesFromLBI
::
Verbosity
->
FilePath
->
String
->
(
LBI
.
Component
->
Bool
)
->
IO
ComponentNames
componentNamesFromLBI
distPref
targetsDescr
compPred
=
do
componentNamesFromLBI
verbosity
distPref
targetsDescr
compPred
=
do
eLBI
<-
tryGetPersistBuildConfig
distPref
case
eLBI
of
Left
err
->
case
err
of
...
...
@@ -834,7 +835,10 @@ componentNamesFromLBI distPref targetsDescr compPred = do
.
filter
compPred
$
LBI
.
pkgComponents
pkgDescr
if
null
names
then
die
$
"Package has no buildable "
++
targetsDescr
++
"."
then
do
notice
verbosity
$
"Package has no buildable "
++
targetsDescr
++
"."
exitSuccess
-- See #3215.
else
return
$!
(
ComponentNames
names
)
benchmarkAction
::
(
BenchmarkFlags
,
BuildFlags
,
BuildExFlags
)
...
...
@@ -863,7 +867,7 @@ benchmarkAction (benchmarkFlags, buildFlags, buildExFlags)
benchmarkFlags'
=
benchmarkFlags
{
benchmarkDistPref
=
toFlag
distPref
}
-- The package was just configured, so the LBI must be available.
names
<-
componentNamesFromLBI
distPref
"benchmarks"
names
<-
componentNamesFromLBI
verbosity
distPref
"benchmarks"
(
\
c
->
case
c
of
{
LBI
.
CBench
{}
->
True
;
_
->
False
;
})
let
extraArgs'
|
null
extraArgs
=
case
names
of
...
...
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