Unit Testing the #DataFlex Order Entry Project Part 1 – Setting up Version Control

I start by making a copy of the project from C:\ DataFlex 18.2 Examples to the folder C:\Projects\Automated Testing.

Making a version control repository

I am using Mercurial, with GUI front-end tool TortoiseHg, but you can do the same in Git. (There are of course many version control systems available, but I wholeheartedly recommend using a distributed version control system, such as Mercurial or Git.)

The first thing I do is create a Mercurial repository. In Windows Explorer, right click on the folder “Order Entry”, select TortoiseHg, and “Create Repository Here”

Creating a repository

I keep the default settings, and select Create.

New Repository dialog

Before checking in the workspace, I tell Mercurial to ignore certain files that are created automatically. A good starting point is Dennis Piccioni’s blog entry, Configuring Source Control for Visual DataFlex. I end up with the following .hgignore file:

syntax: glob

Programs/*.exe

Programs/*.dbg

Programs/*.exe.manifest

AppSrc/*.dep

AppSrc/*.prn

AppSrc/*.fld

AppSrc/*.pbg

AppSrc/*.pdp

AppSrc/*.pkd

AppSrc/*.prp

AppSrc/*.err

Data/*.cch

DDSrc/*.bak

Programs/Reindex.log

IDESrc/*.dsk

IDESrc/StudioMetaData.mtd

IDESrc/Workspace.loc

Finally, I check in all the files. First, I select the Commit view in TortoiseHg.

Commit view.PNG

Then, I select all the files, press the Commit button, and enter a commit message (confirming to add the selected untracked files).

Committing.PNG

Finally, I start DataFlex Studio, compile and run the Order Entry project, and check to see if any files have changed.

In TortoiseHg, in the Commit view, I press F5 (refresh), and see that two files have indeed changed:

changed files.PNG

Upon closer investigation, the Order.cfg file has AutoIncrementBuild=1. So this file will change every time I compile the project. Since these files don’t contain any information that I am interested in for this particular project, I right-click on the files and add them to .hgignore.

Now we have our project under version control, and can move with greater freedom – because we can always go back if we mess something up.

The final step is to add the VDFUnit library as a subrepository for the project.

Advertisement

Published by

Ola Eldøy

I started programming in 1985 when I got my first computer, a Dragon 32.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s