1 {-# LANGUAGE OverloadedLists #-}
2 {-# LANGUAGE OverloadedStrings #-}
4 module UnitTests
.Distribution
.Client
.Init
.FileCreators
9 import Test
.Tasty
.HUnit
11 import UnitTests
.Distribution
.Client
.Init
.Utils
13 import Distribution
.Client
.Init
.FileCreators
14 import Distribution
.Client
.Init
.NonInteractive
.Command
15 import Distribution
.Client
.Init
.Types
16 import Distribution
.Client
.Types
17 import Distribution
.Simple
18 import Distribution
.Simple
.Flag
19 import Distribution
.Simple
.PackageIndex
20 import Distribution
.Verbosity
26 -> InstalledPackageIndex
29 tests _v _initFlags comp pkgIx srcDb
=
31 "Distribution.Client.Init.FileCreators"
32 [ testCase
"Check . as source directory" $ do
35 { packageType
= Flag LibraryAndExecutable
36 , minimal
= Flag
False
37 , overwrite
= Flag
False
38 , packageDir
= Flag
"/home/test/test-package"
39 , extraDoc
= Flag
["CHANGELOG.md"]
40 , exposedModules
= Flag
[]
41 , otherModules
= Flag
[]
43 , buildTools
= Flag
[]
44 , mainIs
= Flag
"quxApp/Main.hs"
45 , dependencies
= Flag
[]
46 , sourceDirs
= Flag
["."]
49 -- createProject stuff
53 , "[\"quxTest/Main.hs\"]"
54 , -- writeProject stuff
65 -- writeDirectoriesSafe
70 -- writeDirectoriesSafe
74 , -- prepareTestTarget
75 -- writeDirectoriesSafe
84 case flip runPrompt inputs
$ do
85 projSettings
<- createProject comp silent pkgIx srcDb dummyFlags
'
86 writeProject projSettings
of
87 Left
(BreakException ex
) -> assertFailure
$ show ex