Cake.GoogleTest
1.0.0
dotnet add package Cake.GoogleTest --version 1.0.0
NuGet\Install-Package Cake.GoogleTest -Version 1.0.0
<PackageReference Include="Cake.GoogleTest" Version="1.0.0" />
<PackageVersion Include="Cake.GoogleTest" Version="1.0.0" />
<PackageReference Include="Cake.GoogleTest" />
paket add Cake.GoogleTest --version 1.0.0
#r "nuget: Cake.GoogleTest, 1.0.0"
#:package Cake.GoogleTest@1.0.0
#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 | Versions 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. |
-
net8.0
- Cake.Core (>= 5.0.0)
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 |