apotocki/googletest
GoogleTest and GoogleMock, Google's C++ test framework.
- Library
- googletest
- Newest
- 1.18.0 (r1, android)
- Targets
- android, linux, windows
- License
- BSD-3-Clause
- Homepage
- https://github.com/google/googletest
- Keywords
- testing, gtest, gmock
Use it
In otok.toml:
[deps.googletest]
recipe = "apotocki/googletest"
version = "~> 1.18.0"
Versions
| Version | Target | Channel | Published | Status |
|---|---|---|---|---|
| 1.18.0 (r1, android) | android | stable | 2026-11-07 | |
| 1.18.0 (r1, linux) | linux | stable | 2026-11-07 | |
| 1.18.0 (r1, windows) | windows | stable | 2026-11-07 |
1.18.0 (r1, android)
Platforms
android
Toolchains
cmake { default-recipe = "apotocki/cmake", version = ">= 3.20" }ninja { default-recipe = "apotocki/ninja", version = ">= 1.10" }
Recipe files
build.lua
-- The CMake project with gmock, without its own tests: libgtest.a, libgtest_main.a, libgmock.a,
-- libgmock_main.a, and one include/ with gtest/ and gmock/.
function build(slice, options, deps)
otok.cmake{
defines = { BUILD_GMOCK = true, INSTALL_GTEST = true },
}
local p = slice.prefix
local libraries = {}
for _, name in ipairs{ "gtest", "gtest_main", "gmock", "gmock_main" } do
libraries[name] = p .. "/lib/lib" .. name .. ".a"
end
return { libraries = libraries, headers = p .. "/include" }
end
recipe.toml
# The otok recipe of GoogleTest (https://github.com/apotocki/otok): gtest and gmock with their main libraries,
# static, for the native tests of Android apps, from the release tag.
[recipe]
api = 1
library = "googletest"
name = "googletest"
version = "1.18.0"
revision = 1
license = "BSD-3-Clause"
license-files = ["LICENSE"]
homepage = "https://github.com/google/googletest"
description = "GoogleTest and GoogleMock, Google's C++ test framework."
keywords = ["testing", "gtest", "gmock"]
linkage = ["static"]
cxx-standard = ">= 17"
[source]
git = "https://github.com/google/googletest"
commit = "063de7e9578f82b369302001269680b4b1553359"
tag = "v1.18.0"
[platforms]
supported = ["android"]
build-on = ["*/ndk"]
[toolchains]
cmake = { version = ">= 3.20", default-recipe = "apotocki/cmake" }
ninja = { version = ">= 1.10", default-recipe = "apotocki/ninja" }
[[product]]
name = "GTest"
libraries = ["gtest"]
link = { runtime = "c++" }
[[product]]
name = "GTestMain"
libraries = ["gtest_main"]
headers = false
depends = ["GTest"]
[[product]]
name = "GMock"
libraries = ["gmock"]
headers = false
depends = ["GTest"]
[[product]]
name = "GMockMain"
libraries = ["gmock_main"]
headers = false
depends = ["GMock"]