Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
ad1b28b4
Unverified
Commit
ad1b28b4
authored
Jun 02, 2023
by
Pratyush Choudhary
Committed by
GitHub
Jun 02, 2023
Browse files
Merge branch 'google:main' into readme_table_fix
parents
ded275d7
06f44bc9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
40 deletions
+30
-40
docs/platforms.md
docs/platforms.md
+6
-33
docs/quickstart-bazel.md
docs/quickstart-bazel.md
+8
-1
googletest/cmake/internal_utils.cmake
googletest/cmake/internal_utils.cmake
+12
-2
googletest_deps.bzl
googletest_deps.bzl
+4
-4
No files found.
docs/platforms.md
View file @
ad1b28b4
# Supported Platforms
# Supported Platforms
GoogleTest requires a codebase and compiler compliant with the C++11 standard or
GoogleTest follows Google's
newer.
[
Foundational C++ Support Policy
](
https://opensource.google/documentation/policies/cplusplus-support
)
.
See
The GoogleTest code is officially supported on the following platforms.
[
this table
](
https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md
)
Operating systems or tools not listed below are community-supported. For
for a list of currently supported versions compilers, platforms, and build
community-supported platforms, patches that do not complicate the code may be
tools.
considered.
If you notice any problems on your platform, please file an issue on the
[
GoogleTest GitHub Issue Tracker
](
https://github.com/google/googletest/issues
)
.
Pull requests containing fixes are welcome!
### Operating systems
*
Linux
*
macOS
*
Windows
### Compilers
*
gcc 5.0+
*
clang 5.0+
*
MSVC 2015+
**macOS users:**
Xcode 9.3+ provides clang 5.0+.
### Build systems
*
[
Bazel
](
https://bazel.build/
)
*
[
CMake
](
https://cmake.org/
)
Bazel is the build system used by the team internally and in tests. CMake is
supported on a best-effort basis and by the community.
docs/quickstart-bazel.md
View file @
ad1b28b4
...
@@ -105,10 +105,17 @@ file (`@com_google_googletest`). For more information about Bazel `BUILD` files,
...
@@ -105,10 +105,17 @@ file (`@com_google_googletest`). For more information about Bazel `BUILD` files,
see the
see the
[
Bazel C++ Tutorial
](
https://docs.bazel.build/versions/main/tutorial/cpp.html
)
.
[
Bazel C++ Tutorial
](
https://docs.bazel.build/versions/main/tutorial/cpp.html
)
.
{: .callout .note}
NOTE: In the example below, we assume Clang or GCC and set
`--cxxopt=-std=c++14`
to ensure that GoogleTest is compiled as C++14 instead of the compiler's default
setting (which could be C++11). For MSVC, the equivalent would be
`--cxxopt=/std:c++14`
. See
[
Supported Platforms
](
platforms.md
)
for more details
on supported language versions.
Now you can build and run your test:
Now you can build and run your test:
<pre>
<pre>
<strong>
my_workspace$ bazel test --test_output=all //:hello_test
</strong>
<strong>
my_workspace$ bazel test
--cxxopt=-std=c++14
--test_output=all //:hello_test
</strong>
INFO: Analyzed target //:hello_test (26 packages loaded, 362 targets configured).
INFO: Analyzed target //:hello_test (26 packages loaded, 362 targets configured).
INFO: Found 1 test target...
INFO: Found 1 test target...
INFO: From Testing //:hello_test:
INFO: From Testing //:hello_test:
...
...
googletest/cmake/internal_utils.cmake
View file @
ad1b28b4
...
@@ -94,12 +94,22 @@ macro(config_compiler_and_linker)
...
@@ -94,12 +94,22 @@ macro(config_compiler_and_linker)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"MSVC"
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"MSVC"
)
set
(
cxx_base_flags
"
${
cxx_base_flags
}
-utf-8"
)
set
(
cxx_base_flags
"
${
cxx_base_flags
}
-utf-8"
)
endif
()
endif
()
elseif
(
CMAKE_CXX_COMPILER_ID STREQUAL
"Clang"
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"IntelLLVM"
)
set
(
cxx_base_flags
"
${
cxx_base_flags
}
/fp:precise -Wno-inconsistent-missing-override -Wno-microsoft-exception-spec -Wno-unused-function -Wno-unused-but-set-variable"
)
endif
()
elseif
(
CMAKE_CXX_COMPILER_ID STREQUAL
"Clang"
OR
CMAKE_CXX_COMPILER_ID STREQUAL
"IntelLLVM"
)
set
(
cxx_base_flags
"-Wall -Wshadow -Wconversion -Wundef"
)
set
(
cxx_base_flags
"-Wall -Wshadow -Wconversion -Wundef"
)
set
(
cxx_exception_flags
"-fexceptions"
)
set
(
cxx_exception_flags
"-fexceptions"
)
set
(
cxx_no_exception_flags
"-fno-exceptions"
)
set
(
cxx_no_exception_flags
"-fno-exceptions"
)
set
(
cxx_strict_flags
"-W -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wunused-parameter -Wcast-align
-Wchar-subscripts
-Winline -Wredundant-decls"
)
set
(
cxx_strict_flags
"-W -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wunused-parameter -Wcast-align -Winline -Wredundant-decls"
)
set
(
cxx_no_rtti_flags
"-fno-rtti"
)
set
(
cxx_no_rtti_flags
"-fno-rtti"
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"Clang"
)
set
(
cxx_strict_flags
"
${
cxx_strict_flags
}
-Wchar-subscripts"
)
endif
()
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"IntelLLVM"
)
set
(
cxx_base_flags
"
${
cxx_base_flags
}
-Wno-implicit-float-size-conversion -ffp-model=precise"
)
endif
()
elseif
(
CMAKE_COMPILER_IS_GNUCXX
)
elseif
(
CMAKE_COMPILER_IS_GNUCXX
)
set
(
cxx_base_flags
"-Wall -Wshadow -Wundef"
)
set
(
cxx_base_flags
"-Wall -Wshadow -Wundef"
)
if
(
NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0
)
if
(
NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0
)
...
...
googletest_deps.bzl
View file @
ad1b28b4
...
@@ -7,10 +7,10 @@ def googletest_deps():
...
@@ -7,10 +7,10 @@ def googletest_deps():
if
not
native
.
existing_rule
(
"com_googlesource_code_re2"
):
if
not
native
.
existing_rule
(
"com_googlesource_code_re2"
):
http_archive
(
http_archive
(
name
=
"com_googlesource_code_re2"
,
# 202
2-12-21T14:29:10Z
name
=
"com_googlesource_code_re2"
,
# 202
3-06-01
sha256
=
"
b9ce3a51beebb38534d11d40f8928d40509b9e18a735f6a4a97ad3d014c87cb5
"
,
sha256
=
"
1726508efc93a50854c92e3f7ac66eb28f0e57652e413f11d7c1e28f97d997ba
"
,
strip_prefix
=
"re2-
d0b1f8f2ecc2ea74956c7608b6f915175314ff0e
"
,
strip_prefix
=
"re2-
03da4fc0857c285e3a26782f6bc8931c4c950df4
"
,
urls
=
[
"https://github.com/google/re2/archive/
d0b1f8f2ecc2ea74956c7608b6f915175314ff0e
.zip"
],
urls
=
[
"https://github.com/google/re2/archive/
03da4fc0857c285e3a26782f6bc8931c4c950df4
.zip"
],
)
)
if
not
native
.
existing_rule
(
"com_google_absl"
):
if
not
native
.
existing_rule
(
"com_google_absl"
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment