Skip to content

Commit 16a11bd

Browse files
committed
Test with a time cost of duplicate imports
1 parent 2aa2f28 commit 16a11bd

File tree

2 files changed

+328
-0
lines changed

2 files changed

+328
-0
lines changed

cabal-testsuite/PackageTests/ConditionalAndImport/cabal.out

Lines changed: 324 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,330 @@ Configuration is affected by the following files:
439439
imported by: yops/yops-1.config
440440
imported by: yops-0.project
441441
Up to date
442+
# checking that we detect when the same config is imported via many different paths
443+
# cabal v2-build
444+
Warning: 10 imports of https://www.stackage.org/lts-21.25/cabal.config;
445+
https://www.stackage.org/lts-21.25/cabal.config
446+
imported by: woops-2.config
447+
imported by: woops/woops-1.config
448+
imported by: woops-0.project
449+
https://www.stackage.org/lts-21.25/cabal.config
450+
imported by: woops/woops-3.config
451+
imported by: woops-2.config
452+
imported by: woops/woops-1.config
453+
imported by: woops-0.project
454+
https://www.stackage.org/lts-21.25/cabal.config
455+
imported by: woops-4.config
456+
imported by: woops/woops-3.config
457+
imported by: woops-2.config
458+
imported by: woops/woops-1.config
459+
imported by: woops-0.project
460+
https://www.stackage.org/lts-21.25/cabal.config
461+
imported by: woops/woops-5.config
462+
imported by: woops-4.config
463+
imported by: woops/woops-3.config
464+
imported by: woops-2.config
465+
imported by: woops/woops-1.config
466+
imported by: woops-0.project
467+
https://www.stackage.org/lts-21.25/cabal.config
468+
imported by: woops-6.config
469+
imported by: woops/woops-5.config
470+
imported by: woops-4.config
471+
imported by: woops/woops-3.config
472+
imported by: woops-2.config
473+
imported by: woops/woops-1.config
474+
imported by: woops-0.project
475+
https://www.stackage.org/lts-21.25/cabal.config
476+
imported by: woops/woops-7.config
477+
imported by: woops-6.config
478+
imported by: woops/woops-5.config
479+
imported by: woops-4.config
480+
imported by: woops/woops-3.config
481+
imported by: woops-2.config
482+
imported by: woops/woops-1.config
483+
imported by: woops-0.project
484+
https://www.stackage.org/lts-21.25/cabal.config
485+
imported by: woops-8.config
486+
imported by: woops/woops-7.config
487+
imported by: woops-6.config
488+
imported by: woops/woops-5.config
489+
imported by: woops-4.config
490+
imported by: woops/woops-3.config
491+
imported by: woops-2.config
492+
imported by: woops/woops-1.config
493+
imported by: woops-0.project
494+
https://www.stackage.org/lts-21.25/cabal.config
495+
imported by: woops/woops-9.config
496+
imported by: woops-8.config
497+
imported by: woops/woops-7.config
498+
imported by: woops-6.config
499+
imported by: woops/woops-5.config
500+
imported by: woops-4.config
501+
imported by: woops/woops-3.config
502+
imported by: woops-2.config
503+
imported by: woops/woops-1.config
504+
imported by: woops-0.project
505+
Warning: 2 imports of woops-4.config;
506+
woops-4.config
507+
imported by: woops/woops-3.config
508+
imported by: woops-0.project
509+
woops-4.config
510+
imported by: woops/woops-3.config
511+
imported by: woops-2.config
512+
imported by: woops/woops-1.config
513+
imported by: woops-0.project
514+
Warning: 2 imports of woops-6.config;
515+
woops-6.config
516+
imported by: woops/woops-5.config
517+
imported by: woops-4.config
518+
imported by: woops/woops-3.config
519+
imported by: woops-0.project
520+
woops-6.config
521+
imported by: woops/woops-5.config
522+
imported by: woops-4.config
523+
imported by: woops/woops-3.config
524+
imported by: woops-2.config
525+
imported by: woops/woops-1.config
526+
imported by: woops-0.project
527+
Warning: 2 imports of woops-8.config;
528+
woops-8.config
529+
imported by: woops/woops-7.config
530+
imported by: woops-6.config
531+
imported by: woops/woops-5.config
532+
imported by: woops-4.config
533+
imported by: woops/woops-3.config
534+
imported by: woops-0.project
535+
woops-8.config
536+
imported by: woops/woops-7.config
537+
imported by: woops-6.config
538+
imported by: woops/woops-5.config
539+
imported by: woops-4.config
540+
imported by: woops/woops-3.config
541+
imported by: woops-2.config
542+
imported by: woops/woops-1.config
543+
imported by: woops-0.project
544+
Warning: 2 imports of woops/woops-3.config;
545+
woops/woops-3.config
546+
imported by: woops-0.project
547+
woops/woops-3.config
548+
imported by: woops-2.config
549+
imported by: woops/woops-1.config
550+
imported by: woops-0.project
551+
Warning: 2 imports of woops/woops-5.config;
552+
woops/woops-5.config
553+
imported by: woops-4.config
554+
imported by: woops/woops-3.config
555+
imported by: woops-0.project
556+
woops/woops-5.config
557+
imported by: woops-4.config
558+
imported by: woops/woops-3.config
559+
imported by: woops-2.config
560+
imported by: woops/woops-1.config
561+
imported by: woops-0.project
562+
Warning: 2 imports of woops/woops-7.config;
563+
woops/woops-7.config
564+
imported by: woops-6.config
565+
imported by: woops/woops-5.config
566+
imported by: woops-4.config
567+
imported by: woops/woops-3.config
568+
imported by: woops-0.project
569+
woops/woops-7.config
570+
imported by: woops-6.config
571+
imported by: woops/woops-5.config
572+
imported by: woops-4.config
573+
imported by: woops/woops-3.config
574+
imported by: woops-2.config
575+
imported by: woops/woops-1.config
576+
imported by: woops-0.project
577+
Warning: 2 imports of woops/woops-9.config;
578+
woops/woops-9.config
579+
imported by: woops-8.config
580+
imported by: woops/woops-7.config
581+
imported by: woops-6.config
582+
imported by: woops/woops-5.config
583+
imported by: woops-4.config
584+
imported by: woops/woops-3.config
585+
imported by: woops-0.project
586+
woops/woops-9.config
587+
imported by: woops-8.config
588+
imported by: woops/woops-7.config
589+
imported by: woops-6.config
590+
imported by: woops/woops-5.config
591+
imported by: woops-4.config
592+
imported by: woops/woops-3.config
593+
imported by: woops-2.config
594+
imported by: woops/woops-1.config
595+
imported by: woops-0.project
596+
Configuration is affected by the following files:
597+
- woops-0.project
598+
- woops-2.config
599+
imported by: woops/woops-1.config
600+
imported by: woops-0.project
601+
- woops-4.config
602+
imported by: woops/woops-3.config
603+
imported by: woops-0.project
604+
- woops-4.config
605+
imported by: woops/woops-3.config
606+
imported by: woops-2.config
607+
imported by: woops/woops-1.config
608+
imported by: woops-0.project
609+
- woops-6.config
610+
imported by: woops/woops-5.config
611+
imported by: woops-4.config
612+
imported by: woops/woops-3.config
613+
imported by: woops-0.project
614+
- woops-6.config
615+
imported by: woops/woops-5.config
616+
imported by: woops-4.config
617+
imported by: woops/woops-3.config
618+
imported by: woops-2.config
619+
imported by: woops/woops-1.config
620+
imported by: woops-0.project
621+
- woops-8.config
622+
imported by: woops/woops-7.config
623+
imported by: woops-6.config
624+
imported by: woops/woops-5.config
625+
imported by: woops-4.config
626+
imported by: woops/woops-3.config
627+
imported by: woops-0.project
628+
- woops-8.config
629+
imported by: woops/woops-7.config
630+
imported by: woops-6.config
631+
imported by: woops/woops-5.config
632+
imported by: woops-4.config
633+
imported by: woops/woops-3.config
634+
imported by: woops-2.config
635+
imported by: woops/woops-1.config
636+
imported by: woops-0.project
637+
- woops/woops-1.config
638+
imported by: woops-0.project
639+
- woops/woops-3.config
640+
imported by: woops-0.project
641+
- woops/woops-3.config
642+
imported by: woops-2.config
643+
imported by: woops/woops-1.config
644+
imported by: woops-0.project
645+
- woops/woops-5.config
646+
imported by: woops-4.config
647+
imported by: woops/woops-3.config
648+
imported by: woops-0.project
649+
- woops/woops-5.config
650+
imported by: woops-4.config
651+
imported by: woops/woops-3.config
652+
imported by: woops-2.config
653+
imported by: woops/woops-1.config
654+
imported by: woops-0.project
655+
- woops/woops-7.config
656+
imported by: woops-6.config
657+
imported by: woops/woops-5.config
658+
imported by: woops-4.config
659+
imported by: woops/woops-3.config
660+
imported by: woops-0.project
661+
- woops/woops-7.config
662+
imported by: woops-6.config
663+
imported by: woops/woops-5.config
664+
imported by: woops-4.config
665+
imported by: woops/woops-3.config
666+
imported by: woops-2.config
667+
imported by: woops/woops-1.config
668+
imported by: woops-0.project
669+
- woops/woops-9.config
670+
imported by: woops-8.config
671+
imported by: woops/woops-7.config
672+
imported by: woops-6.config
673+
imported by: woops/woops-5.config
674+
imported by: woops-4.config
675+
imported by: woops/woops-3.config
676+
imported by: woops-0.project
677+
- woops/woops-9.config
678+
imported by: woops-8.config
679+
imported by: woops/woops-7.config
680+
imported by: woops-6.config
681+
imported by: woops/woops-5.config
682+
imported by: woops-4.config
683+
imported by: woops/woops-3.config
684+
imported by: woops-2.config
685+
imported by: woops/woops-1.config
686+
imported by: woops-0.project
687+
- https://www.stackage.org/lts-21.25/cabal.config
688+
imported by: woops-2.config
689+
imported by: woops/woops-1.config
690+
imported by: woops-0.project
691+
- https://www.stackage.org/lts-21.25/cabal.config
692+
imported by: woops-4.config
693+
imported by: woops/woops-3.config
694+
imported by: woops-2.config
695+
imported by: woops/woops-1.config
696+
imported by: woops-0.project
697+
- https://www.stackage.org/lts-21.25/cabal.config
698+
imported by: woops-6.config
699+
imported by: woops/woops-5.config
700+
imported by: woops-4.config
701+
imported by: woops/woops-3.config
702+
imported by: woops-2.config
703+
imported by: woops/woops-1.config
704+
imported by: woops-0.project
705+
- https://www.stackage.org/lts-21.25/cabal.config
706+
imported by: woops-8.config
707+
imported by: woops/woops-7.config
708+
imported by: woops-6.config
709+
imported by: woops/woops-5.config
710+
imported by: woops-4.config
711+
imported by: woops/woops-3.config
712+
imported by: woops-2.config
713+
imported by: woops/woops-1.config
714+
imported by: woops-0.project
715+
- https://www.stackage.org/lts-21.25/cabal.config
716+
imported by: woops/woops-1.config
717+
imported by: woops-0.project
718+
- https://www.stackage.org/lts-21.25/cabal.config
719+
imported by: woops/woops-3.config
720+
imported by: woops-2.config
721+
imported by: woops/woops-1.config
722+
imported by: woops-0.project
723+
- https://www.stackage.org/lts-21.25/cabal.config
724+
imported by: woops/woops-5.config
725+
imported by: woops-4.config
726+
imported by: woops/woops-3.config
727+
imported by: woops-2.config
728+
imported by: woops/woops-1.config
729+
imported by: woops-0.project
730+
- https://www.stackage.org/lts-21.25/cabal.config
731+
imported by: woops/woops-7.config
732+
imported by: woops-6.config
733+
imported by: woops/woops-5.config
734+
imported by: woops-4.config
735+
imported by: woops/woops-3.config
736+
imported by: woops-2.config
737+
imported by: woops/woops-1.config
738+
imported by: woops-0.project
739+
- https://www.stackage.org/lts-21.25/cabal.config
740+
imported by: woops/woops-9.config
741+
imported by: woops-8.config
742+
imported by: woops/woops-7.config
743+
imported by: woops-6.config
744+
imported by: woops/woops-5.config
745+
imported by: woops-4.config
746+
imported by: woops/woops-3.config
747+
imported by: woops-0.project
748+
- https://www.stackage.org/lts-21.25/cabal.config
749+
imported by: woops/woops-9.config
750+
imported by: woops-8.config
751+
imported by: woops/woops-7.config
752+
imported by: woops-6.config
753+
imported by: woops/woops-5.config
754+
imported by: woops-4.config
755+
imported by: woops/woops-3.config
756+
imported by: woops-2.config
757+
imported by: woops/woops-1.config
758+
imported by: woops-0.project
759+
Resolving dependencies...
760+
Build profile: -w ghc-9.4.8 -O1
761+
In order, the following will be built:
762+
- my-0.1 (lib:my) (first run)
763+
Configuring my-0.1...
764+
Preprocessing library for my-0.1...
765+
Building library for my-0.1...
442766
# checking bad conditional
443767
# cabal v2-build
444768
Error: [Cabal-7090]

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do
163163
yopping <- cabal' "v2-build" [ "--project-file=yops-0.project" ]
164164
assertOutputContains "Warning: 2 imports" yopping
165165

166+
log "checking that we detect when the same config is imported via many different paths"
167+
wooping <- cabal' "v2-build" [ "--project-file=woops-0.project" ]
168+
assertOutputContains "Warning: 10 imports" wooping
169+
166170
log "checking bad conditional"
167171
badIf <- fails $ cabal' "v2-build" [ "--project-file=bad-conditional.project" ]
168172
assertOutputContains "Cannot set compiler in a conditional clause of a cabal project file" badIf

0 commit comments

Comments
 (0)