Executing module tests as part of MPS build usually requires writing non-trivial build scripts, which then need to be integrated into the main MPS build script at the correct place. This HOWTO describes the easier solution, which requires declaring a TestModuleManifest  and keeping the jetbrains.mps.build.tests.generatedTests up-to-date.

Inner working details

The module tests during the MPS build are executed by the ant script  build/test.xml, which calls the targets "build" and "check" in the generated file build/tests/mpsTestModules.xml.

The prototype model of the latter file (jetbrains.mps.ide.build.tests.generatedTests) is itself generated from the user-defined test manifests collected in another auxiliary model (jetbrains.mps.build.mps.testModules). 

This last model contains a single instance of TestProjectConfiguration enumerating the test module manifests to be included in the test process. 

Following are the detailed instructions on using this functionality.

Step-by-step guide

  1. In your test model declare an instance of TestModuleManifest (a root node).
  2. Populate this instance with the references to languages/solutions that execution of your test require. 
    NOTE: only the modules in addition to the standard MPS configuration need to be listed.
  3. Open the model jetbrains.mps.build.mps.testModules and add a reference to this manifest to the list in mpsTestModules root.
    NOTE: this model contains a single instance of TestProjectConfiguration named "mpsTestModules". It is not expected to contain anything beside this root node.
  4. Invoke the action "Refresh Test Project" on the same root node mpsTestModules. This may require invoking "Go To Action".
    This action updates the contents of the model jetbrains.mps.ide.build.tests.generatedTests.
    NOTE: all manual changes in this model will be lost. DONT EDIT THIS MODEL.
    HINT: the action "Refresh Test Project" is defined by the plug-in solution build.mps.testManifest.pluginSolution.
  5. After running make on the project, the build files should be updated and ready to run the tests. 


You may also want to use visual panels to communicate related information, tips or things users need to be aware of.

Related articles

Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.

Related issues