私の.cabal
ファイルには、次の hspec 構成が含まれています。
-- The name of the package.
name: MyModule
version: 0.1.0.0
cabal-version: >=1.10
...
test-suite my-tests
ghc-options: -Wall -Werror
cpp-options: -DTEST
default-extensions: OverloadedStrings
type: exitcode-stdio-1.0
main-is: HSpecTests.hs
hs-source-dirs: tests
build-depends: MyModule, base >= 4.8 && < 4.9, containers >= 0.5 && <0.6, split >= 0.2 && < 0.3, hspec
default-language: Haskell2010
私のディレクトリ構造は次のとおりです。
MyProject
| - src
| - Main.hs
| - Other.hs
| - tests
| -HSpecTests.hs
| - dist
| - MyProj.cabal
を実行するcabal build
と、ソースが正常に実行可能ファイルにビルドされます./dist/build/myproj/myproj
。
cabal build
次に失敗します:
cabal: can't find source for HSpecTests in
dist/build/my-tests/my-tests-tmp, tests
build
ディレクトリを調べると、ディレクトリmy-tests
が見つからないことがわかります。
を に変更すると、次のhs-source-dirs
ようになりsrc/tests
ます。
cabal: can't find source for HSpecTests in
dist/build/my-tests/my-tests-tmp, src/tests
すべてのテストをルート/テストの下の最上位に移動し、.cabal
ファイルを次のように変更すると、次のようになりますhs-source-dirs: tests
。
<command line>: cannot satisfy -package-id MyModule-0.1.0.0-inplace
(use -v for more information)
これをどのように誤って構成しましたか?