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
f1a91921
Commit
f1a91921
authored
3 years ago
by
FraserBrooks
Committed by
mergify-bot
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Integration test for targetselector when proj root symlink/junction
parent
d7a2add2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cabal-install/tests/IntegrationTests2.hs
+29
-6
29 additions, 6 deletions
cabal-install/tests/IntegrationTests2.hs
cabal-install/tests/IntegrationTests2/targets/symbolic-link-to-simple
+1
-0
1 addition, 0 deletions
...l/tests/IntegrationTests2/targets/symbolic-link-to-simple
with
30 additions
and
6 deletions
cabal-install/tests/IntegrationTests2.hs
+
29
−
6
View file @
f1a91921
...
...
@@ -98,12 +98,13 @@ tests config =
,
testCase
"proj conf1"
(
testExceptionInProjectConfig
config
)
]
,
testGroup
"Target selectors"
$
[
testCaseSteps
"valid"
testTargetSelectors
,
testCase
"bad syntax"
testTargetSelectorBadSyntax
,
testCaseSteps
"ambiguous syntax"
testTargetSelectorAmbiguous
,
testCase
"no current pkg"
testTargetSelectorNoCurrentPackage
,
testCase
"no targets"
testTargetSelectorNoTargets
,
testCase
"project empty"
testTargetSelectorProjectEmpty
[
testCaseSteps
"valid"
testTargetSelectors
,
testCase
"bad syntax"
testTargetSelectorBadSyntax
,
testCaseSteps
"ambiguous syntax"
testTargetSelectorAmbiguous
,
testCase
"no current pkg"
testTargetSelectorNoCurrentPackage
,
testCase
"no targets"
testTargetSelectorNoTargets
,
testCase
"project empty"
testTargetSelectorProjectEmpty
,
testCase
"canonicalized path"
testTargetSelectorCanonicalizedPath
,
testCase
"problems (common)"
(
testTargetProblemsCommon
config
)
,
testCaseSteps
"problems (build)"
(
testTargetProblemsBuild
config
)
,
testCaseSteps
"problems (repl)"
(
testTargetProblemsRepl
config
)
...
...
@@ -554,6 +555,28 @@ testTargetSelectorProjectEmpty = do
config
=
mempty
-- | Ensure we don't miss primary package and produce
-- TargetSelectorNoTargetsInCwd error due to symlink or
-- drive capitalisation mismatch when no targets are given
testTargetSelectorCanonicalizedPath
::
Assertion
testTargetSelectorCanonicalizedPath
=
do
(
_
,
_
,
_
,
localPackages
,
_
)
<-
configureProject
testdir
config
cwd
<-
getCurrentDirectory
let
virtcwd
=
cwd
</>
basedir
</>
symlink
-- Check that the symlink is there before running test as on Windows
-- some versions/configurations of git won't pull down/create the symlink
canRunTest
<-
doesDirectoryExist
virtcwd
when
canRunTest
(
do
let
dirActions'
=
(
dirActions
symlink
)
{
TS
.
getCurrentDirectory
=
return
virtcwd
}
Right
ts
<-
readTargetSelectorsWith
dirActions'
localPackages
Nothing
[]
ts
@?=
[
TargetPackage
TargetImplicitCwd
[
"p-0.1"
]
Nothing
])
cleanProject
testdir
where
testdir
=
"targets/simple"
symlink
=
"targets/symbolic-link-to-simple"
config
=
mempty
testTargetProblemsCommon
::
ProjectConfig
->
Assertion
testTargetProblemsCommon
config0
=
do
(
_
,
elaboratedPlan
,
_
)
<-
planProject
testdir
config
...
...
This diff is collapsed.
Click to expand it.
cabal-install/tests/IntegrationTests2/targets/symbolic-link-to-simple
0 → 120000
+
1
−
0
View file @
f1a91921
./simple
\ No newline at end of file
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