简体   繁体   中英

Entry point for test suite with multiple files in Cabal project?

New to Cabal, so sorry if this is obvious, but I obviously want to have more than one file in my Cabal project's test suite, yet the .cabal file is insisting on being given an entrypoint. What do I put for this?

For example, if I have two modules in my library and want to test each in their own test file. One is no more important than the other, so how do I go about making one of the files an entrypoint?

You could make two test suites.

test-suite A
    main-is: test-module-A.hs

test-suite B
    main-is: test-module-B.hs

Or you could make a single suite that imports both test modules.

test-suite both
    main-is: test-both.hs
    other-modules: TestA, TestB

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM