Putting MbUnit In Source Control

If you code for a living, you should be familiar with using a source control server to store and keep prior versions of all your code. Having to check in your code with a named account means everyone knows whose code broke the build :) Even if you code solo or just for a hobby, there are still good reasons why single user source control is a good idea.

But why add the MbUnit dlls into the source control for your project? So that you have a clear and apparent record of which version of MbUnit you’ve been using and so that your NAnt or MSBuild scripts have a readily available copy of that version of MbUnit available to run your tests with.

Let’s look at how we’ve structured the source tree for MbUnit Gallio. (We can only suggest what we do ourselves after all).

The MbUnit Gallio source tree.

This screenshot shows the top directory for MbUnit Gallio. It is organised with the following intent

  • The root is the upper most point of our project’s development tree.
  • All files belonging to this project exist under the root.
  • No files belonging to any other project exist under the root.
  • All source code resides in a sub-folder under the root (called src).
  • All third party code used in project resides in a different sub-folder under the root from your source code (called libs)
  • Build and license files sit in the root folder.

Calling the directories libs and src is entirely our choice - the subtext team call the libs directory “BuildTools” for instance but it works for us.