Skip to content

Commit 6426b05

Browse files
committed
Move unique duplicates to own test
1 parent e8d4894 commit 6426b05

28 files changed

+71
-290
lines changed

cabal-testsuite/PackageTests/ConditionalAndImport/cabal.out

Lines changed: 0 additions & 255 deletions
Original file line numberDiff line numberDiff line change
@@ -194,261 +194,6 @@ Could not resolve dependencies:
194194
(constraint from oops-0.project requires ==1.4.3.0)
195195
[__1] fail (backjumping, conflict set: hashable, oops)
196196
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: hashable (3), oops (2)
197-
# checking that we detect when the same config is imported via many different paths
198-
# cabal v2-build
199-
Warning: 2 imports of yops-4.config;
200-
yops-4.config
201-
imported by: yops/yops-3.config
202-
imported by: yops-0.project
203-
yops-4.config
204-
imported by: yops/yops-3.config
205-
imported by: yops-2.config
206-
imported by: yops/yops-1.config
207-
imported by: yops-0.project
208-
Warning: 2 imports of yops-6.config;
209-
yops-6.config
210-
imported by: yops/yops-5.config
211-
imported by: yops-4.config
212-
imported by: yops/yops-3.config
213-
imported by: yops-0.project
214-
yops-6.config
215-
imported by: yops/yops-5.config
216-
imported by: yops-4.config
217-
imported by: yops/yops-3.config
218-
imported by: yops-2.config
219-
imported by: yops/yops-1.config
220-
imported by: yops-0.project
221-
Warning: 2 imports of yops-8.config;
222-
yops-8.config
223-
imported by: yops/yops-7.config
224-
imported by: yops-6.config
225-
imported by: yops/yops-5.config
226-
imported by: yops-4.config
227-
imported by: yops/yops-3.config
228-
imported by: yops-0.project
229-
yops-8.config
230-
imported by: yops/yops-7.config
231-
imported by: yops-6.config
232-
imported by: yops/yops-5.config
233-
imported by: yops-4.config
234-
imported by: yops/yops-3.config
235-
imported by: yops-2.config
236-
imported by: yops/yops-1.config
237-
imported by: yops-0.project
238-
Warning: 2 imports of yops/yops-3.config;
239-
yops/yops-3.config
240-
imported by: yops-0.project
241-
yops/yops-3.config
242-
imported by: yops-2.config
243-
imported by: yops/yops-1.config
244-
imported by: yops-0.project
245-
Warning: 2 imports of yops/yops-5.config;
246-
yops/yops-5.config
247-
imported by: yops-4.config
248-
imported by: yops/yops-3.config
249-
imported by: yops-0.project
250-
yops/yops-5.config
251-
imported by: yops-4.config
252-
imported by: yops/yops-3.config
253-
imported by: yops-2.config
254-
imported by: yops/yops-1.config
255-
imported by: yops-0.project
256-
Warning: 2 imports of yops/yops-7.config;
257-
yops/yops-7.config
258-
imported by: yops-6.config
259-
imported by: yops/yops-5.config
260-
imported by: yops-4.config
261-
imported by: yops/yops-3.config
262-
imported by: yops-0.project
263-
yops/yops-7.config
264-
imported by: yops-6.config
265-
imported by: yops/yops-5.config
266-
imported by: yops-4.config
267-
imported by: yops/yops-3.config
268-
imported by: yops-2.config
269-
imported by: yops/yops-1.config
270-
imported by: yops-0.project
271-
Warning: 2 imports of yops/yops-9.config;
272-
yops/yops-9.config
273-
imported by: yops-8.config
274-
imported by: yops/yops-7.config
275-
imported by: yops-6.config
276-
imported by: yops/yops-5.config
277-
imported by: yops-4.config
278-
imported by: yops/yops-3.config
279-
imported by: yops-0.project
280-
yops/yops-9.config
281-
imported by: yops-8.config
282-
imported by: yops/yops-7.config
283-
imported by: yops-6.config
284-
imported by: yops/yops-5.config
285-
imported by: yops-4.config
286-
imported by: yops/yops-3.config
287-
imported by: yops-2.config
288-
imported by: yops/yops-1.config
289-
imported by: yops-0.project
290-
Up to date
291-
# checking that we detect when the same config is imported via many different paths
292-
# cabal v2-build
293-
Warning: 10 imports of https://www.stackage.org/lts-21.25/cabal.config;
294-
https://www.stackage.org/lts-21.25/cabal.config
295-
imported by: woops-2.config
296-
imported by: woops/woops-1.config
297-
imported by: woops-0.project
298-
https://www.stackage.org/lts-21.25/cabal.config
299-
imported by: woops/woops-3.config
300-
imported by: woops-2.config
301-
imported by: woops/woops-1.config
302-
imported by: woops-0.project
303-
https://www.stackage.org/lts-21.25/cabal.config
304-
imported by: woops-4.config
305-
imported by: woops/woops-3.config
306-
imported by: woops-2.config
307-
imported by: woops/woops-1.config
308-
imported by: woops-0.project
309-
https://www.stackage.org/lts-21.25/cabal.config
310-
imported by: woops/woops-5.config
311-
imported by: woops-4.config
312-
imported by: woops/woops-3.config
313-
imported by: woops-2.config
314-
imported by: woops/woops-1.config
315-
imported by: woops-0.project
316-
https://www.stackage.org/lts-21.25/cabal.config
317-
imported by: woops-6.config
318-
imported by: woops/woops-5.config
319-
imported by: woops-4.config
320-
imported by: woops/woops-3.config
321-
imported by: woops-2.config
322-
imported by: woops/woops-1.config
323-
imported by: woops-0.project
324-
https://www.stackage.org/lts-21.25/cabal.config
325-
imported by: woops/woops-7.config
326-
imported by: woops-6.config
327-
imported by: woops/woops-5.config
328-
imported by: woops-4.config
329-
imported by: woops/woops-3.config
330-
imported by: woops-2.config
331-
imported by: woops/woops-1.config
332-
imported by: woops-0.project
333-
https://www.stackage.org/lts-21.25/cabal.config
334-
imported by: woops-8.config
335-
imported by: woops/woops-7.config
336-
imported by: woops-6.config
337-
imported by: woops/woops-5.config
338-
imported by: woops-4.config
339-
imported by: woops/woops-3.config
340-
imported by: woops-2.config
341-
imported by: woops/woops-1.config
342-
imported by: woops-0.project
343-
https://www.stackage.org/lts-21.25/cabal.config
344-
imported by: woops/woops-9.config
345-
imported by: woops-8.config
346-
imported by: woops/woops-7.config
347-
imported by: woops-6.config
348-
imported by: woops/woops-5.config
349-
imported by: woops-4.config
350-
imported by: woops/woops-3.config
351-
imported by: woops-2.config
352-
imported by: woops/woops-1.config
353-
imported by: woops-0.project
354-
Warning: 2 imports of woops-4.config;
355-
woops-4.config
356-
imported by: woops/woops-3.config
357-
imported by: woops-0.project
358-
woops-4.config
359-
imported by: woops/woops-3.config
360-
imported by: woops-2.config
361-
imported by: woops/woops-1.config
362-
imported by: woops-0.project
363-
Warning: 2 imports of woops-6.config;
364-
woops-6.config
365-
imported by: woops/woops-5.config
366-
imported by: woops-4.config
367-
imported by: woops/woops-3.config
368-
imported by: woops-0.project
369-
woops-6.config
370-
imported by: woops/woops-5.config
371-
imported by: woops-4.config
372-
imported by: woops/woops-3.config
373-
imported by: woops-2.config
374-
imported by: woops/woops-1.config
375-
imported by: woops-0.project
376-
Warning: 2 imports of woops-8.config;
377-
woops-8.config
378-
imported by: woops/woops-7.config
379-
imported by: woops-6.config
380-
imported by: woops/woops-5.config
381-
imported by: woops-4.config
382-
imported by: woops/woops-3.config
383-
imported by: woops-0.project
384-
woops-8.config
385-
imported by: woops/woops-7.config
386-
imported by: woops-6.config
387-
imported by: woops/woops-5.config
388-
imported by: woops-4.config
389-
imported by: woops/woops-3.config
390-
imported by: woops-2.config
391-
imported by: woops/woops-1.config
392-
imported by: woops-0.project
393-
Warning: 2 imports of woops/woops-3.config;
394-
woops/woops-3.config
395-
imported by: woops-0.project
396-
woops/woops-3.config
397-
imported by: woops-2.config
398-
imported by: woops/woops-1.config
399-
imported by: woops-0.project
400-
Warning: 2 imports of woops/woops-5.config;
401-
woops/woops-5.config
402-
imported by: woops-4.config
403-
imported by: woops/woops-3.config
404-
imported by: woops-0.project
405-
woops/woops-5.config
406-
imported by: woops-4.config
407-
imported by: woops/woops-3.config
408-
imported by: woops-2.config
409-
imported by: woops/woops-1.config
410-
imported by: woops-0.project
411-
Warning: 2 imports of woops/woops-7.config;
412-
woops/woops-7.config
413-
imported by: woops-6.config
414-
imported by: woops/woops-5.config
415-
imported by: woops-4.config
416-
imported by: woops/woops-3.config
417-
imported by: woops-0.project
418-
woops/woops-7.config
419-
imported by: woops-6.config
420-
imported by: woops/woops-5.config
421-
imported by: woops-4.config
422-
imported by: woops/woops-3.config
423-
imported by: woops-2.config
424-
imported by: woops/woops-1.config
425-
imported by: woops-0.project
426-
Warning: 2 imports of woops/woops-9.config;
427-
woops/woops-9.config
428-
imported by: woops-8.config
429-
imported by: woops/woops-7.config
430-
imported by: woops-6.config
431-
imported by: woops/woops-5.config
432-
imported by: woops-4.config
433-
imported by: woops/woops-3.config
434-
imported by: woops-0.project
435-
woops/woops-9.config
436-
imported by: woops-8.config
437-
imported by: woops/woops-7.config
438-
imported by: woops-6.config
439-
imported by: woops/woops-5.config
440-
imported by: woops-4.config
441-
imported by: woops/woops-3.config
442-
imported by: woops-2.config
443-
imported by: woops/woops-1.config
444-
imported by: woops-0.project
445-
Resolving dependencies...
446-
Build profile: -w ghc-9.4.8 -O1
447-
In order, the following will be built:
448-
- my-0.1 (lib:my) (first run)
449-
Configuring my-0.1...
450-
Preprocessing library for my-0.1...
451-
Building library for my-0.1...
452197
# checking bad conditional
453198
# cabal v2-build
454199
Error: [Cabal-7167]

cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -133,41 +133,6 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do
133133
readFileVerbatim "oops.expect.txt"
134134
>>= flip (assertOn isInfixOf multilineNeedleHaystack) oopsing . normalizePathSeparators
135135

136-
-- The project is named yops as it is like hops but with y's for forks.
137-
-- +-- yops-0.project
138-
-- +-- yops/yops-1.config
139-
-- +-- yops-2.config
140-
-- +-- yops/yops-3.config
141-
-- +-- yops-4.config
142-
-- +-- yops/yops-5.config
143-
-- +-- yops-6.config
144-
-- +-- yops/yops-7.config
145-
-- +-- yops-8.config
146-
-- +-- yops/yops-9.config (no further imports)
147-
-- +-- yops/yops-3.config
148-
-- +-- yops-4.config
149-
-- +-- yops/yops-5.config
150-
-- +-- yops-6.config
151-
-- +-- yops/yops-7.config
152-
-- +-- yops-8.config
153-
-- +-- yops/yops-9.config (no further imports)
154-
-- +-- yops/yops-5.config
155-
-- +-- yops-6.config
156-
-- +-- yops/yops-7.config
157-
-- +-- yops-8.config
158-
-- +-- yops/yops-9.config (no further imports)
159-
-- +-- yops/yops-7.config
160-
-- +-- yops-8.config
161-
-- +-- yops/yops-9.config (no further imports)
162-
-- +-- yops/yops-9.config (no further imports)
163-
log "checking that we detect when the same config is imported via many different paths"
164-
yopping <- cabal' "v2-build" [ "--project-file=yops-0.project", "--project-file-parser=legacy" ]
165-
assertOutputContains "Warning: 2 imports" yopping
166-
167-
log "checking that we detect when the same config is imported via many different paths"
168-
wooping <- cabal' "v2-build" [ "--project-file=woops-0.project", "--project-file-parser=legacy" ]
169-
assertOutputContains "Warning: 10 imports" wooping
170-
171136
log "checking bad conditional"
172137
badIf <- fails $ cabal' "v2-build" [ "--project-file=bad-conditional.project" ]
173138
assertOutputContains "Cannot set compiler in a conditional clause of a cabal project file" badIf
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import Test.Cabal.Prelude
2+
import Test.Cabal.OutputNormalizer
3+
import Data.Function ((&))
4+
import Data.Functor ((<&>))
5+
import Data.List (isInfixOf)
6+
7+
main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do
8+
let log = recordHeader . pure
9+
10+
-- The project is named yops as it is like hops but with y's for forks.
11+
-- +-- yops-0.project
12+
-- +-- yops/yops-1.config
13+
-- +-- yops-2.config
14+
-- +-- yops/yops-3.config
15+
-- +-- yops-4.config
16+
-- +-- yops/yops-5.config
17+
-- +-- yops-6.config
18+
-- +-- yops/yops-7.config
19+
-- +-- yops-8.config
20+
-- +-- yops/yops-9.config (no further imports)
21+
-- +-- yops/yops-3.config
22+
-- +-- yops-4.config
23+
-- +-- yops/yops-5.config
24+
-- +-- yops-6.config
25+
-- +-- yops/yops-7.config
26+
-- +-- yops-8.config
27+
-- +-- yops/yops-9.config (no further imports)
28+
-- +-- yops/yops-5.config
29+
-- +-- yops-6.config
30+
-- +-- yops/yops-7.config
31+
-- +-- yops-8.config
32+
-- +-- yops/yops-9.config (no further imports)
33+
-- +-- yops/yops-7.config
34+
-- +-- yops-8.config
35+
-- +-- yops/yops-9.config (no further imports)
36+
-- +-- yops/yops-9.config (no further imports)
37+
log "checking that we detect when the same config is imported via many different paths"
38+
yopping <- cabal' "v2-build" [ "--project-file=yops-0.project", "--project-file-parser=legacy" ]
39+
assertOutputContains "Warning: 2 imports" yopping
40+
41+
log "checking that we detect when the same config is imported via many different paths"
42+
wooping <- cabal' "v2-build" [ "--project-file=woops-0.project", "--project-file-parser=legacy" ]
43+
assertOutputContains "Warning: 10 imports" wooping
44+
45+
return ()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cabal-version: 1.12
2+
name: hashable
3+
version: 1.4.2.0
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cabal-version: 1.12
2+
name: hashable
3+
version: 1.4.3.0
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module Main where
2+
3+
main :: IO ()
4+
main = putStrLn "hello world"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: some-exe
2+
version: 0.0.1.0
3+
license: BSD3
4+
cabal-version: >= 1.2
5+
build-type: Simple
6+
7+
Executable some-exe
8+
main-is: Main.hs
9+
build-depends: base
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- WARNING: Override the `with-compiler: ghc-x.y.z` of the stackage import, of
2+
-- https://www.stackage.org/nightly-yyyy-mm-dd/cabal.config. Otherwise tests
3+
-- will fail with:
4+
-- -Error: [Cabal-5490]
5+
-- -Cannot find the program 'ghc'. User-specified path 'ghc-x.y.z' does not
6+
-- refer to an executable and the program is not on the system path.
7+
with-compiler: ghc

0 commit comments

Comments
 (0)