Skip to content

Commit 0b9fb75

Browse files
authored
File: allow a File object to be created without its contents being automatically retrieved.
2 parents eaba303 + f428743 commit 0b9fb75

File tree

172 files changed

+7648
-2189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+7648
-2189
lines changed

extern/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
`libOpenCOR <https://opencor.ws/libopencor/index.html>`__ relies on the following external projects:
22

3-
- `GoogleTest <https://github.com/google/googletest>`__ `1.15.2 <https://github.com/google/googletest/releases/tag/v1.15.2>`__;
3+
- `GoogleTest <https://github.com/google/googletest>`__ `1.16.0 <https://github.com/google/googletest/releases/tag/v1.15.2>`__;
44
- `modp_b64 <https://chromium.googlesource.com/chromium/src/third_party/modp_b64/>`__ at commit `7c1b327 <https://chromium.googlesource.com/chromium/src/third_party/modp_b64/+/7c1b3276e72757e854b5b642284aa367436a4723>`__; and
5-
- `nanobind <https://github.com/wjakob/nanobind>`__ `2.1.0 <https://github.com/wjakob/nanobind/releases/tag/v2.1.0>`__.
5+
- `nanobind <https://github.com/wjakob/nanobind>`__ `2.5.0 <https://github.com/wjakob/nanobind/releases/tag/v2.1.0>`__.

extern/googletest/BUILD.bazel

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,19 @@ cc_library(
138138
}),
139139
deps = select({
140140
":has_absl": [
141-
"@com_google_absl//absl/container:flat_hash_set",
142-
"@com_google_absl//absl/debugging:failure_signal_handler",
143-
"@com_google_absl//absl/debugging:stacktrace",
144-
"@com_google_absl//absl/debugging:symbolize",
145-
"@com_google_absl//absl/flags:flag",
146-
"@com_google_absl//absl/flags:parse",
147-
"@com_google_absl//absl/flags:reflection",
148-
"@com_google_absl//absl/flags:usage",
149-
"@com_google_absl//absl/strings",
150-
"@com_google_absl//absl/types:any",
151-
"@com_google_absl//absl/types:optional",
152-
"@com_google_absl//absl/types:variant",
153-
"@com_googlesource_code_re2//:re2",
141+
"@abseil-cpp//absl/container:flat_hash_set",
142+
"@abseil-cpp//absl/debugging:failure_signal_handler",
143+
"@abseil-cpp//absl/debugging:stacktrace",
144+
"@abseil-cpp//absl/debugging:symbolize",
145+
"@abseil-cpp//absl/flags:flag",
146+
"@abseil-cpp//absl/flags:parse",
147+
"@abseil-cpp//absl/flags:reflection",
148+
"@abseil-cpp//absl/flags:usage",
149+
"@abseil-cpp//absl/strings",
150+
"@abseil-cpp//absl/types:any",
151+
"@abseil-cpp//absl/types:optional",
152+
"@abseil-cpp//absl/types:variant",
153+
"@re2//:re2",
154154
],
155155
"//conditions:default": [],
156156
}) + select({

extern/googletest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
cmake_minimum_required(VERSION 3.13)
55

66
project(googletest-distribution)
7-
set(GOOGLETEST_VERSION 1.15.2)
7+
set(GOOGLETEST_VERSION 1.16.0)
88

99
if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX)
1010
set(CMAKE_CXX_EXTENSIONS OFF)

extern/googletest/MODULE.bazel

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,38 +32,45 @@
3232

3333
module(
3434
name = "googletest",
35-
version = "1.15.2",
35+
version = "1.16.0",
3636
compatibility_level = 1,
3737
)
3838

3939
# Only direct dependencies need to be listed below.
4040
# Please keep the versions in sync with the versions in the WORKSPACE file.
4141

42-
bazel_dep(name = "abseil-cpp",
43-
version = "20240116.2",
44-
repo_name = "com_google_absl")
45-
46-
bazel_dep(name = "platforms",
47-
version = "0.0.10")
48-
49-
bazel_dep(name = "re2",
50-
repo_name = "com_googlesource_code_re2",
51-
version = "2024-07-02")
42+
bazel_dep(
43+
name = "abseil-cpp",
44+
version = "20250127.0",
45+
)
46+
bazel_dep(
47+
name = "platforms",
48+
version = "0.0.10",
49+
)
50+
bazel_dep(
51+
name = "re2",
52+
version = "2024-07-02",
53+
)
5254

53-
bazel_dep(name = "rules_python",
54-
version = "0.34.0",
55-
dev_dependency = True)
55+
bazel_dep(
56+
name = "rules_python",
57+
version = "1.1.0",
58+
dev_dependency = True,
59+
)
5660

5761
# https://rules-python.readthedocs.io/en/stable/toolchains.html#library-modules-with-dev-only-python-usage
5862
python = use_extension(
5963
"@rules_python//python/extensions:python.bzl",
6064
"python",
61-
dev_dependency = True
65+
dev_dependency = True,
66+
)
67+
python.toolchain(
68+
ignore_root_user_error = True,
69+
is_default = True,
70+
python_version = "3.12",
6271
)
6372

64-
python.toolchain(python_version = "3.12",
65-
is_default = True,
66-
ignore_root_user_error = True)
67-
68-
fake_fuchsia_sdk = use_repo_rule("//:fake_fuchsia_sdk.bzl", "fake_fuchsia_sdk")
69-
fake_fuchsia_sdk(name = "fuchsia_sdk")
73+
# See fake_fuchsia_sdk.bzl for instructions on how to override this with a real SDK, if needed.
74+
fuchsia_sdk = use_extension("//:fake_fuchsia_sdk.bzl", "fuchsia_sdk")
75+
fuchsia_sdk.create_fake()
76+
use_repo(fuchsia_sdk, "fuchsia_sdk")

extern/googletest/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ GoogleTest now follows the
99
We recommend
1010
[updating to the latest commit in the `main` branch as often as possible](https://github.com/abseil/abseil-cpp/blob/master/FAQ.md#what-is-live-at-head-and-how-do-i-do-it).
1111
We do publish occasional semantic versions, tagged with
12-
`v${major}.${minor}.${patch}` (e.g. `v1.15.0`).
12+
`v${major}.${minor}.${patch}` (e.g. `v1.16.0`).
1313

1414
#### Documentation Updates
1515

1616
Our documentation is now live on GitHub Pages at
1717
https://google.github.io/googletest/. We recommend browsing the documentation on
1818
GitHub Pages rather than directly in the repository.
1919

20-
#### Release 1.15.0
20+
#### Release 1.16.0
2121

22-
[Release 1.15.0](https://github.com/google/googletest/releases/tag/v1.15.0) is
22+
[Release 1.16.0](https://github.com/google/googletest/releases/tag/v1.16.0) is
2323
now available.
2424

25-
The 1.15.x branch requires at least C++14.
25+
The 1.16.x branch requires at least C++14.
2626

2727
#### Continuous Integration
2828

extern/googletest/WORKSPACE

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,47 @@
1-
workspace(name = "com_google_googletest")
1+
# Copyright 2024 Google Inc.
2+
# All Rights Reserved.
3+
#
4+
#
5+
# Redistribution and use in source and binary forms, with or without
6+
# modification, are permitted provided that the following conditions are
7+
# met:
8+
#
9+
# * Redistributions of source code must retain the above copyright
10+
# notice, this list of conditions and the following disclaimer.
11+
# * Redistributions in binary form must reproduce the above
12+
# copyright notice, this list of conditions and the following disclaimer
13+
# in the documentation and/or other materials provided with the
14+
# distribution.
15+
# * Neither the name of Google Inc. nor the names of its
16+
# contributors may be used to endorse or promote products derived from
17+
# this software without specific prior written permission.
18+
#
19+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
31+
workspace(name = "googletest")
232

333
load("//:googletest_deps.bzl", "googletest_deps")
434
googletest_deps()
535

636
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
737

838
http_archive(
9-
name = "rules_python",
10-
sha256 = "d71d2c67e0bce986e1c5a7731b4693226867c45bfe0b7c5e0067228a536fc580",
11-
strip_prefix = "rules_python-0.29.0",
12-
urls = ["https://github.com/bazelbuild/rules_python/releases/download/0.29.0/rules_python-0.29.0.tar.gz"],
39+
name = "rules_python",
40+
sha256 = "9c6e26911a79fbf510a8f06d8eedb40f412023cf7fa6d1461def27116bff022c",
41+
strip_prefix = "rules_python-1.1.0",
42+
url = "https://github.com/bazelbuild/rules_python/releases/download/1.1.0/rules_python-1.1.0.tar.gz",
1343
)
14-
15-
# https://github.com/bazelbuild/rules_python/releases/tag/0.29.0
44+
# https://github.com/bazelbuild/rules_python/releases/tag/1.1.0
1645
load("@rules_python//python:repositories.bzl", "py_repositories")
1746
py_repositories()
1847

extern/googletest/ci/linux-presubmit.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131

3232
set -euox pipefail
3333

34-
readonly LINUX_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20240523"
35-
readonly LINUX_GCC_FLOOR_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-floor:20230120"
34+
readonly LINUX_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20241218"
35+
readonly LINUX_GCC_FLOOR_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-floor:20250205"
3636

3737
if [[ -z ${GTEST_ROOT:-} ]]; then
3838
GTEST_ROOT="$(realpath $(dirname ${0})/..)"

extern/googletest/docs/advanced.md

Lines changed: 56 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ For example:
286286
```c++
287287
TEST(SkipTest, DoesSkip) {
288288
GTEST_SKIP() << "Skipping single test";
289-
EXPECT_EQ(0, 1); // Won't fail; it won't be executed
289+
FAIL(); // Won't fail; it won't be executed
290290
}
291291
292292
class SkipFixture : public ::testing::Test {
@@ -298,7 +298,7 @@ class SkipFixture : public ::testing::Test {
298298
299299
// Tests for SkipFixture won't be executed.
300300
TEST_F(SkipFixture, SkipsOneTest) {
301-
EXPECT_EQ(5, 7); // Won't fail
301+
FAIL(); // Won't fail; it won't be executed
302302
}
303303
```
304304

@@ -405,6 +405,51 @@ EXPECT_TRUE(IsCorrectPointIntVector(point_ints))
405405
For more details regarding `AbslStringify()` and its integration with other
406406
libraries, see go/abslstringify.
407407
408+
## Regular Expression Syntax
409+
410+
When built with Bazel and using Abseil, GoogleTest uses the
411+
[RE2](https://github.com/google/re2/wiki/Syntax) syntax. Otherwise, for POSIX
412+
systems (Linux, Cygwin, Mac), GoogleTest uses the
413+
[POSIX extended regular expression](https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_04)
414+
syntax. To learn about POSIX syntax, you may want to read this
415+
[Wikipedia entry](https://en.wikipedia.org/wiki/Regular_expression#POSIX_extended).
416+
417+
On Windows, GoogleTest uses its own simple regular expression implementation. It
418+
lacks many features. For example, we don't support union (`"x|y"`), grouping
419+
(`"(xy)"`), brackets (`"[xy]"`), and repetition count (`"x{5,7}"`), among
420+
others. Below is what we do support (`A` denotes a literal character, period
421+
(`.`), or a single `\\ ` escape sequence; `x` and `y` denote regular
422+
expressions.):
423+
424+
Expression | Meaning
425+
---------- | --------------------------------------------------------------
426+
`c` | matches any literal character `c`
427+
`\\d` | matches any decimal digit
428+
`\\D` | matches any character that's not a decimal digit
429+
`\\f` | matches `\f`
430+
`\\n` | matches `\n`
431+
`\\r` | matches `\r`
432+
`\\s` | matches any ASCII whitespace, including `\n`
433+
`\\S` | matches any character that's not a whitespace
434+
`\\t` | matches `\t`
435+
`\\v` | matches `\v`
436+
`\\w` | matches any letter, `_`, or decimal digit
437+
`\\W` | matches any character that `\\w` doesn't match
438+
`\\c` | matches any literal character `c`, which must be a punctuation
439+
`.` | matches any single character except `\n`
440+
`A?` | matches 0 or 1 occurrences of `A`
441+
`A*` | matches 0 or many occurrences of `A`
442+
`A+` | matches 1 or many occurrences of `A`
443+
`^` | matches the beginning of a string (not that of each line)
444+
`$` | matches the end of a string (not that of each line)
445+
`xy` | matches `x` followed by `y`
446+
447+
To help you determine which capability is available on your system, GoogleTest
448+
defines macros to govern which regular expression it is using. The macros are:
449+
`GTEST_USES_SIMPLE_RE=1` or `GTEST_USES_POSIX_RE=1`. If you want your death
450+
tests to work in all cases, you can either `#if` on these macros or use the more
451+
limited syntax only.
452+
408453
## Death Tests
409454
410455
In many applications, there are assertions that can cause application failure if
@@ -416,7 +461,7 @@ corruption, security holes, or worse. Hence it is vitally important to test that
416461
such assertion statements work as expected.
417462
418463
Since these precondition checks cause the processes to die, we call such tests
419-
_death tests_. More generally, any test that checks that a program terminates
464+
*death tests*. More generally, any test that checks that a program terminates
420465
(except by throwing an exception) in an expected fashion is also a death test.
421466
422467
Note that if a piece of code throws an exception, we don't consider it "death"
@@ -462,6 +507,12 @@ verifies that:
462507
exit with exit code 0, and
463508
* calling `KillProcess()` kills the process with signal `SIGKILL`.
464509

510+
{: .callout .warning}
511+
Warning: If your death test contains mocks and is expecting a specific exit
512+
code, then you must allow the mock objects to be leaked via `Mock::AllowLeak`.
513+
This is because the mock leak detector will exit with its own error code if it
514+
detects a leak.
515+
465516
The test function body may contain other assertions and statements as well, if
466517
necessary.
467518

@@ -503,51 +554,6 @@ TEST_F(FooDeathTest, DoesThat) {
503554
}
504555
```
505556
506-
### Regular Expression Syntax
507-
508-
When built with Bazel and using Abseil, GoogleTest uses the
509-
[RE2](https://github.com/google/re2/wiki/Syntax) syntax. Otherwise, for POSIX
510-
systems (Linux, Cygwin, Mac), GoogleTest uses the
511-
[POSIX extended regular expression](https://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_04)
512-
syntax. To learn about POSIX syntax, you may want to read this
513-
[Wikipedia entry](https://en.wikipedia.org/wiki/Regular_expression#POSIX_extended).
514-
515-
On Windows, GoogleTest uses its own simple regular expression implementation. It
516-
lacks many features. For example, we don't support union (`"x|y"`), grouping
517-
(`"(xy)"`), brackets (`"[xy]"`), and repetition count (`"x{5,7}"`), among
518-
others. Below is what we do support (`A` denotes a literal character, period
519-
(`.`), or a single `\\ ` escape sequence; `x` and `y` denote regular
520-
expressions.):
521-
522-
Expression | Meaning
523-
---------- | --------------------------------------------------------------
524-
`c` | matches any literal character `c`
525-
`\\d` | matches any decimal digit
526-
`\\D` | matches any character that's not a decimal digit
527-
`\\f` | matches `\f`
528-
`\\n` | matches `\n`
529-
`\\r` | matches `\r`
530-
`\\s` | matches any ASCII whitespace, including `\n`
531-
`\\S` | matches any character that's not a whitespace
532-
`\\t` | matches `\t`
533-
`\\v` | matches `\v`
534-
`\\w` | matches any letter, `_`, or decimal digit
535-
`\\W` | matches any character that `\\w` doesn't match
536-
`\\c` | matches any literal character `c`, which must be a punctuation
537-
`.` | matches any single character except `\n`
538-
`A?` | matches 0 or 1 occurrences of `A`
539-
`A*` | matches 0 or many occurrences of `A`
540-
`A+` | matches 1 or many occurrences of `A`
541-
`^` | matches the beginning of a string (not that of each line)
542-
`$` | matches the end of a string (not that of each line)
543-
`xy` | matches `x` followed by `y`
544-
545-
To help you determine which capability is available on your system, GoogleTest
546-
defines macros to govern which regular expression it is using. The macros are:
547-
`GTEST_USES_SIMPLE_RE=1` or `GTEST_USES_POSIX_RE=1`. If you want your death
548-
tests to work in all cases, you can either `#if` on these macros or use the more
549-
limited syntax only.
550-
551557
### How It Works
552558
553559
See [Death Assertions](reference/assertions.md#death) in the Assertions
@@ -727,7 +733,7 @@ Some tips on using `SCOPED_TRACE`:
727733
### Propagating Fatal Failures
728734

729735
A common pitfall when using `ASSERT_*` and `FAIL*` is not understanding that
730-
when they fail they only abort the _current function_, not the entire test. For
736+
when they fail they only abort the *current function*, not the entire test. For
731737
example, the following test will segfault:
732738

733739
```c++
@@ -2382,7 +2388,7 @@ IMPORTANT: The exact format of the JSON document is subject to change.
23822388

23832389
#### Detecting Test Premature Exit
23842390

2385-
Google Test implements the _premature-exit-file_ protocol for test runners to
2391+
Google Test implements the *premature-exit-file* protocol for test runners to
23862392
catch any kind of unexpected exits of test programs. Upon start, Google Test
23872393
creates the file which will be automatically deleted after all work has been
23882394
finished. Then, the test runner can check if this file exists. In case the file

0 commit comments

Comments
 (0)