Support Statement: Making an Upgrade Unit Test
Overview
A key part of making a good sample is to use <Author><Fix > commands to modify the translation so as to ensure the desired changes are produced systematically and not clouded by various reformatting and other changes made by Visual Studio. Of course you can use VS to help you do the analysis and design the required corrections, but then you go back to the script and redo them using Author/Fix. Note: 1) in the gmStudio Task context menu, the Rebundle operation will combine the files in the deploy folder into a bundle file (*.bnd.new), 2) in your comparison tool (e.g., BeyondCompare) you may see/extract the desired changes easily. A custom NotePad++ macro converts those changes into <Replace> blocks..
MakeTest is an old and primitive utility created many years ago; it does a simple job and it works, but it is a bit clumsy for sharing with customers.
Since its creation, gmStudio has a command-line interface to make new projects. MakeTest should be retired and its features should be added to gmStudio as an option off the help menu. Eventually, this tool would allow picking pieces of VB6 code from the customer codebase to integrate with the test code.
Using MakeTest
The Template ComboBox fills from the SubFolders of the _MakeTest\Templates directory. The Template folders contain the gmStudio files used to "seed" the upgrade files in the test directory.
C:\gmSpec\_MakeTest\TEMPLATES>tree /f
├───_C#_and_VBNet
│ package.cmd
│ Test.gmproj
│ tran.Test.xml
│
└───_C#_Only
package.cmd
Test.gmproj
tran.Test.xml
The Category ComboBox fills with the folders in the working directory of the program. The folders organize the test upgrade codes created by the program.
Arch
ASP
COM
Forms
GmTest
Lang
Migrate
Util
The MakeText folder contains the actual VB6 code files for the test:
clsTest.cls
frmTest.frm
modTest.bas
testCON.vbp
testDLL.vbp
testFORM.vbp
The MakeTest folder also contains the exes and batch files that create the Migration Unit Test (MUT) from these template files:
maketest.cmd
MakeTestApp.exe
ssed.exe
Clicking [Make Test] produces something like the following example:
C:\gmSpec\Lang\MyTest ├───proj │ │ MyTest.gmProj : gmStudio project file │ │ │ ├───package │ │ package.cmd : packaging script for gathering code, results, etc. │ │ │ └───usr │ tran.MyTest.xml : default translation script │ └───src modMyTest.bas : VB6 code MyTest.vbp : VB6 test
I updated the IssuesLab.gmProj so it contains two tasks: one with TaskTag=upg and one with TaskTag=nofix
I modified the IssueLab Author Fixes in ScriptRules.xml so they apply only if TaskTag=”upg”
<ScriptRule id="IssuesLab" Condition="%SrcName%=='Issueslab'">
<Author Condition="%TaskTag%=='upg'">
<Fix name="PostEdit">
<Replace name="correct switch Color">
- The TaskTag=upg reflects the desired results using post-edits to make the changes.
- The TaskTag=nofix reflects the current results produced without the p;ost-edits.
Now, one can run and compare these side by side. That will show us what is done by the tool and what is done by “hand”.