HTF has sample project which shows how to use test framework. Module MyPkg.A defines some tests and MyPkg.B defines some tests. Is it possible to write new module MyPkg.C which aggregates tests from modules A and B (and does not define new tests itself) ?
Instead of importing tests from A and B (in my test runner Main module), I want to import tests from single C module.
I implement MyPkg.C like this
{-# OPTIONS_GHC -F -pgmF htfpp #-}
module MyPkg.C (htf_importedTests) where
import Test.Framework
import {-@ HTF_TESTS @-} MyPkg.A
import {-@ HTF_TESTS @-} MyPkg.B
And my main test runner module like this:
{-# OPTIONS_GHC -F -pgmF htfpp #-}
module Main where
import Test.Framework
import Test.Framework.BlackBoxTest
import {-@ HTF_TESTS @-} MyPkg.C
main = htfMain htf_importedTests
When I try to compile this code, I get an error:
TestMain.hs:23:5:
Not in scope: `htf_MyPkg_C_thisModulesTests'
Perhaps you meant `htf_Main_thisModulesTests'