mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
help: the features of the build listed, and the tests skip what they need
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI MacOS / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI Windows / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Has been cancelled
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI MacOS / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI Windows / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Has been cancelled
3proxy --help (and the usage message of a bad invocation) now lists what the build was made with: TLS and its backend, RADIUS, PCRE, IPv6, UNIX sockets, the built-in HTTP server, transparency, ODBC and the optional proxy services. The test runner reads the list before the first case and the cases state the features they need with t.skip_unless(), so a build without a feature skips its cases instead of failing them; a binary too old to report anything skips the cases with needs and runs the rest.
This commit is contained in:
1 parent
c0d9914fb8
commit
38b62bd30b
37 files changed
+212
-15
No files matched your search
+21
-1
@@ -122,10 +122,11 @@ class Failure(Exception):
|
||||
class Tester:
|
||||
"""The API a case runs against: start servers, make requests, assert."""
|
||||
|
||||
def __init__(self, binary, tmpdir, case):
|
||||
def __init__(self, binary, tmpdir, case, features=None):
|
||||
self.binary = binary
|
||||
self.tmpdir = tmpdir
|
||||
self.case = case
|
||||
self.features = features if features is not None else frozenset()
|
||||
self.servers = []
|
||||
self.checks = []
|
||||
self.timeout = 10
|
||||
@@ -135,6 +136,25 @@ class Tester:
|
||||
self.logs = []
|
||||
self.udp_servers = []
|
||||
|
||||
# ---- build features ----------------------------------------------
|
||||
|
||||
def has(self, *names):
|
||||
"""Whether the binary reports every named feature."""
|
||||
return all(name in self.features for name in names)
|
||||
|
||||
def skip_unless(self, *names):
|
||||
"""Skip what needs a feature the binary was built without.
|
||||
|
||||
Returns False after recording the skip, so a case says
|
||||
`if not t.skip_unless("ssl"): return` and keeps its checks out of
|
||||
the failed count on a build that cannot pass them.
|
||||
"""
|
||||
missing = [name for name in names if name not in self.features]
|
||||
if not missing:
|
||||
return True
|
||||
self.skip("built without: " + ", ".join(missing))
|
||||
return False
|
||||
|
||||
# ---- servers -----------------------------------------------------
|
||||
|
||||
def has_ipv6(self):
|
||||
|
||||
Reference in new issue
Block a user