Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
6a63a43a
Commit
6a63a43a
authored
8 years ago
by
Mikhail Glushenkov
Browse files
Options
Downloads
Patches
Plain Diff
'cabal test': don't fail on no test suites.
Fixes #3215.
parent
70cc6971
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cabal-install/Main.hs
+10
-6
10 additions, 6 deletions
cabal-install/Main.hs
with
10 additions
and
6 deletions
cabal-install/Main.hs
+
10
−
6
View file @
6a63a43a
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment