Pex - Automated Whitebox Testing for .NET : Source Control Interaction

Source Control Interaction

This section describes the different ways Pex can interact with a source control provider: Along the exploration, Pex might generate or modify existing files. Each new file should be added to the source control, while existing files should be checked out before modification.

There are basically 3 scenarios:

  • No source control available, Pex does not do any kind of special operations
  • Running inside of Visual Studio: if you are using the Visual Studio addin, we expect you to rely on the integrated source control.
  • Running from the command line: You need to register and select a source control provider.

Registering Source Control providers

  • use a built-in source control provider or an attribute from the Microsoft.Pex.Framework.SourceControl to define your own,
public sealed class SvnSourceControlAttribute :
    PexProcessSourceControlAttributeBase {
    public SvnControlAttribute (string toolPath)
        : base("svn", "svn.exe")
    { }
    protected override string GetAddArguments(string fileName) {
        return SafeString.Format("add \"{0}\"", fileName);
    protected override string GetCheckOutArguments(string fileName) {
        return SafeString.Format("edit \"{0}\"", fileName);
// assemblyinfo.cs
[assembly: SvnSourceControl]
  • specify the source control name in the command line
pex ... /sc:svn
(c) Microsoft Corporation. All rights reserved. pex Wiki Documentation 0.93.50813.0