The Rocket COBOL extension supports TEST EXPLORER integration for the unit testing framework, MFUnit, provided by the Visual COBOL and Enterprise Developer products.
The TEST EXPLORER shows unit tests within your workspace, and enables you to run and debug them in Visual Studio Code.
Alternatively, you can compile your Visual Studio or Eclipse COBOL test projects from the command line. See The Micro Focus Unit Testing Framework in your Visual COBOL or Enterprise Developer product documentation for details.
A discoverer defines where unit tests are located within a workspace and which runner and COBOL environment should be used to load them. In the settings.json file, use the setting microFocusCOBOL.mfunit.discoverers to configure your test discoverers. To set one or more discoverers:
This opens the settings.json file with the discoverers option ready for input.
As an example, two discoverer configurations can look like:
{ "microFocusCOBOL.mfunit.discoverers": [ { "globPattern": "bin/*.{dll, so}", "is64Bit": false, "runner": "mfurun", }, { "globPattern": "bin.net/*.dll", "is64Bit": false, "runner": "mfurunil", } ] }
Where the following runner options are available in Windows:
Option | Executable | Notes |
mfurun | mfurun.exe | Use with native COBOL. |
mfurunil | mfurunil.exe | Use with .NET COBOL. |
mfurunil6 | mfurunil6.exe | 64-bit only if using a Rocket Software product 9.0 release or later. Use with .NET COBOL. |
mfurunj | mfurunj.bat | Use with JVM COBOL. |
The following runners are used for UNIX platforms.
Option | Notes |
cobmfurun_t | Use with threaded RTS. |
cobmfurun | Use with non-threaded RTS. |
cobmfurunil6 | 64-bit only if using a Rocket Software product 9.0 release or later. Use with .NET COBOL. |
cobmfurunj | Use with JVM COBOL. |
Once a discoverer has been set, you can build the COBOL sources and any tests found in the globPattern will be populated in the TEST EXPLORER. If the unit tests do not populate the TEST EXPLORER:
A test can pass, fail, or encounter an error. The result is indicated by the symbol next to the test file.