Advanced Topics
Auto-loading Test Cases in GUI
It's possible to start ProUnit from Progress Editor having some test cases already loaded. This is very useful on development time when you want to run a specific test. The auto-load is made through a global variable called cInitTestCases, as in the example bellow.
/* Defines the global variable to set the test cases that should be loaded. */ DEFINE NEW GLOBAL SHARED VARIABLE cInitTestCases AS CHARACTER NO-UNDO. ASSIGN cInitTestCases = "sample.p,tst_BaseConverter.p". /* Start the GUI part of ProUnit */ RUN startProUnitGUI.p. |
Running as batch through command line execution
It's possible to run ProUnit for nightly builds using the command line version. This interface only enables you to run the tests, that is, the suite "modeling" must still be done on a Windows station but can be run on virtually any Progress-compatible operating system.
To run ProUnit Command Line Executor you shall use this batchExecutor program:
<DLC>/bin/_progres -b -param "<ProUnit Parameters>" -p startProUnitBatch.p [other Progress parameters] |
Where:
- DLC - Progress installation path.
- ProUnit Parameters - ProUnit execution parameters, see details bellow
- Other Progress startup parameters - Any other Progress startup parameters (-db, -dmy, -H, -S, -pf, etc).
You may configure ProUnit execution using the following parameters:
Parameter | Description | Mandatory |
---|---|---|
-projectFile | Path to the XML file saved using ProUnit GUI version. | YES |
-resultFile | Path to the resulting execution file (XML). | NO |
-resultTemplate | Template used to format the result file. | NO |
-verbose | Configures execution to be silent or to show execution progress and results. | NO |
-runningAnt | Configures ProUnit to run through a PCTRun task (see Automated Nightly Builds topic). | NO |
Here you have some examples:
Runs the projectFile silent and no result file is generated:
_progres -p startProUnitBatch.p -b -param "projectFile=/usr/projects/full.xml" |
Runs the projectFile showing execution progress and results. No result file is generated:
_progres -p startProUnitBatch.p -b -param "projectFile=/usr/projects/full.xml -verbose=true" |
Runs the projectFile silent and save a plain XML file with execution results:
_progres -p startProUnitBatch.p -b -param "projectFile=/projects/full.xml -resultFile=/projects/result.xml" |
Runs the projectFile silent and save a formatted XML file using the default (whose real name is A-ProUnitDefault_XSL) template:
_progres -p startProUnitBatch.p -b -param "projectFile=/projects/full.xml -resultFile=/projects/result.xml -resultTemplate=A-ProUnitDefault_XSL" |
Running as batch through Progress code
It's possible to run ProUnit for nightly builds from a Progress program. Like for command line section, this interface only enables you to run the tests, that is, the suite "modeling" must still be done on a Windows station but can be run on virtually any Progress-compatible operating system.
The auto-run is made through a global variable called cInitBatchParams, as in the example bellow (see this section for more details about this variable content).
/* Defines the global variable to set parameters. */ DEFINE NEW GLOBAL SHARED VARIABLE cInitBatchParams AS CHARACTER NO-UNDO. ASSIGN cInitBatchParams = "-projectFile=d:\pu_batch.xml -resultFile=d:\result.xml -resultTemplate=A-ProUnitDefault_XSL -verbose=true". /* Start the batch part of ProUnit */ RUN startProUnitBatch.p. |
Automated Nightly Builds
You may use ProUnit and PCT (http://www.sourceforge.net/projects/pct) to automate the building and testing of your project. Once you have installed PCT you may run the tests using ProUnit task, like the example bellow:
<ProUnit project="test.xml" result="result.xml" dlcHome="${env.DLC}" template="default"> <propath> <path location="${env.PROUNIT_HOME}" /> </propath> </ProUnit> |