Fink:Major New Feature Plans:Test suite

From the Fink Wiki
Jump to: navigation, search

It sounds like this feature needs to be able to do, at a minimum, the following in an info file:

  • Add extra dependencies for running the tests
  • Behave differently during compilation (ConfigureParams, CompileScript)
  • Specify a script which is run immediately after building and which will invoke the test suite and do some degree of interpretation of the results (exit status 0/1/2 for pass/warning/failure, for instance)

Here's my idea for how to add this to the .info syntax in a backwards-compatible matter. Define a new field, InfoTest, which will be ignored unless running in test mode (either enabled as part of -m or with a new option). (Actually, dmacks says that unknown fields aren't considered a problem, so maybe we don't need these to be in a block.)

Here's what this field can contain:

  • TestDepends (effectively appended to BuildDepends, probably also want a corresponding TestConflicts just in case)
  • TestConfigureParams (appended to ConfigureParams)
  • TestCompileScript (replaces CompileScript; appending to CompileScript isn't useful, that can just go in TestScript) You can just specify a CompileScript inside the InfoTest instead.
  • TestScript (run the tests and exit with 0/1/>1 for pass/warning/error)
  • TestSource and related fields (treated as "higher N than the highest SourceN)
  • TestSuiteSize: Optional. Valid values are small, medium, and large. Some day we might want to provide a way for users to express "run the test suite by default if it won't take too long".

It can also contain anything from the regular .info file and it would be interpreted normally, replacing the value outside the InfoTest.