Configuring the Run-Time System Environment

You can configure certain elements of the run-time system environment in which your tests run. You can configure your environment manually using the methods discussed in Run-Time System Configuration, but those settings will remain in place for each subsequent set of tests run until you reconfigure the environment. The Micro Focus Unit Testing Framework contains some more efficient methods to managing run-time settings, by using configuration files capable of configuring certain settings when you initiate a particular test run.

The following table demonstrates the types of configuration file available:

File COBOL Test Type File Format Extension Environment variables Run-time tunables
Portable environment file Native, .NET 8, .NET Framework, and .NET COBOL Text .mfuenv Y N
Application configuration file Native Binary .mfgcf Y Y
config file .NET COBOL Text .config Y N
Portable environment files
This type of file is used to maintain environment variables that are reused in a number of different test types, run on different platforms; for example, a test case intended to run on both Windows and UNIX can use variables designed to supply platform-specific data, via the configuration file.
A portable environment file uses a number of pre-defined sections in which you can re-use the same variable, with different values. When the test is compiled and run in different scenarios, the Micro Focus Unit Testing Framework recognizes the scenario and selects the appropriate variable value. For more information on the different sections and how to configure the contents, see The Portable Environment File.
This type of file is text-based, as so can be coded with any text editor. Ensure it has the same base name as the base name of your test suite (i.e. the base name of your .dll, .int, .gnt, or .mfu file), and with an extension of .mfuenv, and then place it in the same location as your test suite to use it during the test run.
Application configuration files
This type of file is used in native COBOL tests, and can contain environment variables and run-time tunables.
It must have the same base name as the base name of your test suite (i.e. the base name of your .dll, .int, .gnt, or .mfu file), and an extension of .mfgcf. Place this file in the same location as your test suite to use it during the test run.
Use your IDE to create the application configuration file; see Application Configuration File for more information.
Note: You do not need to set the COBCONFIG.BLOCK environment variable when using an application configuration file with the Micro Focus Unit Testing Framework on the command line.
.NET Procedural COBOL tests
This type of file is used in procedural .NET COBOL tests, and can contain environment variables.
If you are running tests from the command line, the application configuration file must have the same base name as the base name of your test suite (i.e. the base name of your .dll, or .mfu file), and an extension of .config. Place this file in the same location as your test suite and it will be used during the test run.
If you are running the tests from within the IDE, add a new .NET application configuration file to the test project, and then rename it to test-project-name.config. Also, set the Copy to output directory of this file to Always.