Skip to content

Commit 0293545

Browse files
committed
Merge branch 'stable-6.0' into bugfix/nonblocking_socket
2 parents 76f3df8 + 789164a commit 0293545

File tree

9 files changed

+129
-8
lines changed

9 files changed

+129
-8
lines changed

CHANGELOG

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ Release 6.0.27 (Not yet released)
55
* [Ruby] Fix compatibility with Rack 2 While maintaining compatibility with Rack 3. Closes GH-2595.
66
* [Ruby] Use non-deprecated functions in native extensions.
77
* Fix an issue where Passenger could freeze while connecting to application processes (event loop blocking).
8+
* Updated various library versions used in precompiled binaries (used for e.g. gem installs):
9+
- ccache: 4.10.2 -> 4.11.2
10+
- cmake: 3.31.3 -> 3.31.6
11+
- curl: 8.11.1 -> 8.12.1
12+
- git: 2.47.1 -> 2.49.0
13+
- libassuan: 3.0.1 -> 3.0.2
14+
- libffi: 3.4.6 -> 3.4.7
15+
- openssl: 3.4.0 -> 3.4.1
16+
- pcre2: 10.44 -> 10.45
17+
- rubies
18+
- 3.2.6 -> 3.2.7
19+
- 3.3.6 -> 3.3.7
20+
- 3.4.1 -> 3.4.2
21+
- rubygems: 3.6.2 -> 3.6.6
22+
- zstd: 1.5.6 -> 1.5.7
823
*
924

1025

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ The `test:cxx` unit test suite contains many different test groups. You can run
140140

141141
rake test:cxx GROUPS='ApplicationPool2_PoolTest,UtilsTest'
142142

143-
You can also run just a single test within a suite. Pass the relevant test number like this:
143+
You can also run specific tests within a suite. Pass the relevant test number(s) like this:
144144

145-
rake test:cxx GROUPS='ApplicationPool2_PoolTest:82'
145+
rake test:cxx GROUPS='ApplicationPool2_PoolTest:82,83'
146146

147147
You can also run the C++ tests in GDB or Valgrind. We have a useful GDB config file in `test/gdbinit.example`. You should copy it to `test/.gdbinit` and edit it.
148148

doc/CxxTestingGuide.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# C++ testing guide
2+
3+
C++ tests use a modified version of the [Tut test framework](https://mrzechonek.github.io/tut-framework/).
4+
5+
Test files are placed in test/cxx/SomethingTest.cpp.
6+
7+
## Test suite example
8+
9+
```c++
10+
#include <TestSupport.h> // Always include this
11+
#include <Something.h> // The class to test
12+
13+
// Always use these namespaces
14+
using namespace std;
15+
using namespace boost;
16+
using namespace Passenger;
17+
18+
namespace tut {
19+
// Each test suite has a corresponding context struct, created and
20+
// deleted for every test case. You can put test case-local state here.
21+
struct SomethingTest: public TestBase {
22+
Something something;
23+
};
24+
25+
TEST_METHOD(1) {
26+
set_test_name("Description for test 1");
27+
28+
// Test logic here.
29+
// `this` is a SomethingTest instance.
30+
31+
ensure_equals("Description for assertion 1", 1, something.foo());
32+
ensure_equals("Description for assertion 2", 2, something.bar());
33+
}
34+
35+
TEST_METHOD(2) {
36+
set_test_name("Description for test 2");
37+
38+
// Test logic here.
39+
// `this` is a SomethingTest instance.
40+
}
41+
}
42+
```
43+
44+
## Available assertions
45+
46+
- `ensure([description,] bool)` — Asserts argument is true.
47+
- `ensure_not([description,] bool)`
48+
- `ensure_equals([description,] actual, expected)` — Asserts `actual == expected`.
49+
- `ensure_not_equals([description,] actual, expected)`
50+
- `ensure_gt(description, a, b)` — Asserts `a > b`.
51+
- `ensure_distance([description,] a, b, d)` — Asserts the distance between `a` and `b` is <= `d`.
52+
- `fail(description)` — Fails the test case.
53+
54+
### Special assertions for multithreaded code
55+
56+
- `EVENTUALLY(deadlineSeconds, code)` — Asserts that "something eventually happens".
57+
58+
Runs `code` in a loop, sleeping for 10 msec each time, until code set `result = true` or timeout.
59+
60+
Example:
61+
62+
```c++
63+
EVENTUALLY(5,
64+
result = fileExists("foo.txt");
65+
);
66+
```
67+
68+
Notes:
69+
70+
- `code` is in a new lexical context, so defining variables there is fine.
71+
- Since EVENTUALLY is for multithreaded use cases, remember to synchronize access to shared state.
72+
73+
- `EVENTUALLY2(deadlineMsec, sleeptimeMsec, code)` — Same as EVENTUALLY but with finer timing customization.
74+
75+
- `SHOULD_NEVER_HAPPEN(deadlineMsec, code)` — Asserts that "something should never happen".
76+
77+
Runs `code` in a loop for `deadlineMsec`. If `code` sets `result = true`, the test fails.
78+
79+
Example:
80+
81+
```c++
82+
SHOULD_NEVER_HAPPEN(1000,
83+
result = checkSocketDisconnected();
84+
);
85+
```
86+
87+
The notes for `EVENTUALLY()` also apply here.
88+
89+
## Mocking
90+
91+
See [C++ mocking strategy](CxxMockingStrategy.md).
92+
93+
## Running tests
94+
95+
Prerequisite: ensure `test/config.json` exists. Refer to its `.example` file.
96+
97+
```bash
98+
# Run all test suites
99+
rake test:cxx GROUPS=SomethingTest
100+
101+
# Run specific test suites
102+
rake test:cxx GROUPS=SomethingTest,AnotherTest
103+
104+
# Run specific tests by number
105+
rake test:cxx GROUPS=SomethingTest:1,3
106+
107+
# Attach to GDB or LLDB
108+
rake test:cxx GROUPS=SomethingTest GDB=1
109+
rake test:cxx GROUPS=SomethingTest LLDB=1
110+
```

packaging/homebrew

src/agent/Core/ApiServer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <oxt/thread.hpp>
3333
#include <string>
3434
#include <cstring>
35-
#include <exception>
3635
#include <sys/types.h>
3736

3837
#include <jsoncpp/json.h>

src/agent/Core/ApplicationPool/Group.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#include <sys/types.h>
4343
#include <sys/stat.h>
4444
#include <cstdlib>
45-
#include <cassert>
4645
#include <MemoryKit/palloc.h>
4746
#include <WrapperRegistry/Registry.h>
4847
#include <Hooks.h>

src/agent/Core/Controller/Client.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#define _PASSENGER_REQUEST_HANDLER_CLIENT_H_
2828

2929
#include <ev++.h>
30-
#include <ostream>
3130
#include <ServerKit/HttpClient.h>
3231
#include <Core/Controller/Request.h>
3332

src/agent/Core/SecurityUpdateChecker.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#define _PASSENGER_SECURITY_UPDATE_CHECKER_H_
2828

2929
#include <string>
30-
#include <cassert>
3130
#include <boost/config.hpp>
3231
#include <boost/scoped_ptr.hpp>
3332
#include <oxt/thread.hpp>

0 commit comments

Comments
 (0)