Cake.GoogleTest 1.0.0

dotnet add package Cake.GoogleTest --version 1.0.0
                    
NuGet\Install-Package Cake.GoogleTest -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cake.GoogleTest" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cake.GoogleTest" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Cake.GoogleTest" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cake.GoogleTest --version 1.0.0
                    
#r "nuget: Cake.GoogleTest, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cake.GoogleTest@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cake.GoogleTest&version=1.0.0
                    

Cake.GoogleTest

A Cake build extension for executing Google test assemblies.

Installation

Cake.GoogleTest can be installed from the package manager console:

Install-Package Cake.GoogleTest

It can also be used via a reference in your Cake build script using the #addin directive:

#addin nuget:?package=Cake.GoogleTest

Usage

Assuming you have built your native test assembly which uses Google test:

var result = GoogleTestRun(GetRootedPath(executable));
if(!result)
{
    Error("A failure occurred when running tests");
}

This will result in the test application being executed and the results being output to the console.

If you want to write test results to a file you can specify the output by providing a settings instance:

var result = GoogleTestRun(GetRootedPath(executable), new GoogleTestSettings
{
    Output = new XmlTestOutput(GetRootedPath(outputFile))
});
if(!result)
{
    Error("A failure occurred when running tests");
}

Test results can be output to Xml or Json.

If you need to use a custom process runner, as you may do when collecting coverage information, you can provide it like so:

var processRunner = new CustomProcessRunner();

var result = GoogleTestRun(processRunner, GetRootedPath(executable), new GoogleTestSettings
{
    Output = new XmlTestOutput(GetRootedPath(outputFile))
});
if(!result)
{
    Error("A failure occurred when running tests");
}

Settings

The GoogleTestSettings class implements most of the settings supported by a Google test assembly. Any that are not can be provided via the AdditionalArguments field.

Field Corresponding Setting
ColoredOutput --gtest_color
Filter --gtest_filter
Output --gtest_output
OnlyDisplayFailures --gtest_brief
PrintTestTime --gtest_print_time
FailFast --gtest_fail_fast
RandomSeed --gtest_random_seed
RepeatCount --gtest_repeat
RecreateEnvironmentsWhenRepeating --gtest_recreate_environments_when_repeating
RunDisabledTests --gtest_also_run_disabled_tests
Shuffle --gtest_shuffle
ThrowOnFailure --gtest_throw_on_failure
BreakOnFailure --gtest_break_on_failure
CatchExceptions --gtest_catch_exceptions
AdditionalArguments None
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 185 7/19/2025