/DiffEngine

Manages launching and cleanup of diff tools

Primary LanguageC#MIT LicenseMIT

DiffEngine

Discussions Build status NuGet Status NuGet Status

DiffEngine manages launching and cleanup of diff tools. It is designed to be used by any Snapshot/Approval testing library.

See Milestones for release notes.

Currently used by:

Sponsors

Entity Framework Extensions

Entity Framework Extensions is a major sponsor and is proud to contribute to the development this project.

Entity Framework Extensions

JetBrains

JetBrains logo.

Contents

NuGet

Launching a tool

A tool can be launched using the following:

await DiffRunner.LaunchAsync(tempFile, targetFile);

snippet source | anchor

Note that this method will respect the above difference behavior in terms of Auto refresh and MDI behaviors.

Closing a tool

A tool can be closed using the following:

DiffRunner.Kill(file1, file2);

snippet source | anchor

Note that this method will respect the above difference behavior in terms of MDI behavior.

File type detection

DiffEngine use EmptyFiles to determine if a given file or extension is a binary or text. Custom extensions can be added, or existing ones changed.

BuildServerDetector

BuildServerDetector.Detected returns true if the current code is running on a build/CI server.

Supports:

There are also individual properties to check for each specific build system

var isWsl = BuildServerDetector.IsWsl;
var isTravis = BuildServerDetector.IsTravis;
var isJenkins = BuildServerDetector.IsJenkins;
var isGithubAction = BuildServerDetector.IsGithubAction;
var isAzureDevops = BuildServerDetector.IsAzureDevops;
var isTeamCity = BuildServerDetector.IsTeamCity;
var isGitLab = BuildServerDetector.IsGitLab;
var isMyGet = BuildServerDetector.IsMyGet;
var isGoDc = BuildServerDetector.IsGoDc;
var isDocker = BuildServerDetector.IsDocker;
var isAppVeyor = BuildServerDetector.IsAppVeyor;

snippet source | anchor

Disable for a machine/process

Set an environment variable DiffEngine_Disabled with the value true.

Disable in code

DiffRunner.Disabled = true;

Icons

Game designed by Andrejs Kirma from The Noun Project.

Tray icons from LineIcons.