Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split HTF into several packages #57

Closed
skogsbaer opened this issue Nov 13, 2015 · 3 comments
Closed

Split HTF into several packages #57

skogsbaer opened this issue Nov 13, 2015 · 3 comments

Comments

@skogsbaer
Copy link
Owner

Currently, HTF is a big, monolithic package. It would be nice to split HTF into several smaller packages. This has the following benefits:

  • extensibility: e.g. support for other test methods such as smallcheck
  • possibly fewer dependencies
  • choices for the user: for example, the user can decide whether to have source code locations in assertion failures, and how these source code locations are realized (template haskell, htfpp, or something different)

I could imagine the following packages:

HTF-core

The core of HTF. Defines how tests are organized and executed. This could include the following modules:

  • Test.Framework.AssertM
  • Test.Framework.History
  • Test.Framework.JsonOutput
  • Test.Framework.Location
  • Test.Framework.CmdlineOptions
  • Test.Framework.Colors
  • Test.Framework.Pretty
  • Test.Framework.PrettyHaskell
  • Test.Framework.TestInterface
  • Test.Framework.TestManager
  • Test.Framework.TestReporter
  • Test.Framework.TestTypes
  • Test.Framework.XmlOutput
  • Test.Framework.ThreadPool

We could split HTF-core even in even smaller parts by abstracting over how test results are reported. I think we should post this split.

Things to consider:

  • It should be possible to write and execute simple tests with HTF-core.

HTF-UnitTests

HTF adapter for HUnit. Includes the current module

  • Test.Framework.HUnitWrapper

HTF-QuickCheck

HTF adapter for QuickCheck. Includes the current module

  • Test.Framework.QuickCheckWrapper

HTF-ShellTests

Shell-based tests with HTF. Includes the current module

  • Test.Framework.BlackBoxTest

(I suggest renaming "black box tests" to "shell tests")

HTF-preprocessor

The htfpp preprocessor. Includes the current module

  • Test.Framework.Preprocessor

htfpp needs a configuration file where we define the prefix to look for and the expansion code for a given prefix. This is necessary to be able to extend htfpp to new test providers (e.g. smallcheck). There should be a sensible default configuration file for all know test providers.

HTF

The HTF umbrella package, defining a sensible default set of package dependencies. Its functionality is the same as the current HTF package. Also includes the tutorial:

  • Test.Framework.Tutorial
@lslah
Copy link
Contributor

lslah commented Nov 18, 2015

We could start adding separate library entries to HTF.cabal for all of the suggested sub-packages. If at some point a library only depends on other libraries and its own modules, it should be easy to extract the whole thing into a separate package.

@skogsbaer
Copy link
Owner Author

Seems like a good start. I would suggest that we do the restructuring without adding any new functionality or changing functionality. For example, we just leave the preprocessor "as is" and add the config file later. With this approach, we can run the tests at the end and make sure that everything works as before.

I think the dependencies should be as follows:

  • HTF-core: only external dependencies
  • HTF-preprocessor: only external dependencies (the generated code has more dependencies)
  • HTF-UnitTests, HTF-QuickCheck, HTF-ShellTests: on HTF-core
  • HTF: HTF-core, HTF-preprocessor, HTF-UnitTests, HTF-QuickCheck, HTF-ShellTests:

@skogsbaer
Copy link
Owner Author

Closing this because I won't fix it. I'm happy to accept PRs, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants