|
OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
|
Functions | |
| parse_results (text) | |
| load_expected (path) | |
| compare (results, expected, flaky=frozenset()) | |
| write_launcher (directory, wine, exe) | |
| strict_port (launcher, game_dir) | |
| smoke_args (game_dir, binary, protocol, stock) | |
| main () | |
Variables | |
| ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| RESULT = re.compile(r'^(ok |FAIL) (?P<name>.+?)( \(.*\))?$') | |
| str | HEADER = '# Fallos esperados de smoke_test.py con el servidor de opencod2; solo se achica.\n' |
| tuple | WINE_HEADER |
| dict | DEFAULT_BINARY = {115: 'build/check-linux-10/cod2_lnxded', 118: 'build/check-linux/cod2_lnxded'} |
| str | LAUNCHER |
Runs smoke_test.py against this repo's server and compares its failures with a list.
python3 scripts/opencod2_smoke.py /path/to/CoD2 --protocol {115|118} [--binary PATH] [--wine WINE] [--update]
smoke_test.py comes unchanged from CoD2rev-Plus, so it also checks features this
server does not have yet. Those failures are listed in
test/smoke_expected_failures_<protocol>.txt. Exit codes: 0 when the failures
match the list, 1 when a check not on the list fails, 2 when a listed check now
passes (the list only shrinks: run again with --update), 3 when smoke_test.py
printed no results. The checks in test/smoke_flaky.txt are timing-dependent
with this server and count neither way.
With --wine, --binary is the Windows server (cod2_win32_ded.exe) and WINE the
command that runs it (scripts/portable_wine.sh). smoke_test.py runs a launcher
that gives wine the paths as Windows sees them; the list is then
test/smoke_expected_failures_wine.txt, since the Windows server prints only to
its console window and a signal does not reach it as one under wine.
net_strictPort, which smoke_test.py checks in the output, is checked here in
its console log instead: the failed bind and no other port tried.
| opencod2_smoke.compare | ( | results, | |
| expected, | |||
| flaky = frozenset() ) |
(failures not on the list, listed checks that no longer fail or no longer exist), flaky ones aside.
| opencod2_smoke.load_expected | ( | path | ) |
The check names in a list file, one per line; blank lines and # comments are skipped.
| opencod2_smoke.main | ( | ) |
| opencod2_smoke.parse_results | ( | text | ) |
{check name: passed} for every ok/FAIL line of smoke_test.py's output.
| opencod2_smoke.smoke_args | ( | game_dir, | |
| binary, | |||
| protocol, | |||
| stock ) |
smoke_test.py's command line: the 1.3 builds are OpenCoD2-Plus Server's Plus variant (--plus) unless built with -DCOD2_PLUS_PROTOCOL=OFF (stock).
| opencod2_smoke.strict_port | ( | launcher, | |
| game_dir ) |
net_strictPort 1 under wine: on a busy port the server fails to bind it and tries no other (without net_strictPort it takes the next one). Its fatal error goes to a message box, where it waits, not to its console log, so it is ended here once the log shows the failed bind and nothing after it.
| opencod2_smoke.write_launcher | ( | directory, | |
| wine, | |||
| exe ) |
| dict opencod2_smoke.DEFAULT_BINARY = {115: 'build/check-linux-10/cod2_lnxded', 118: 'build/check-linux/cod2_lnxded'} |
| str opencod2_smoke.HEADER = '# Fallos esperados de smoke_test.py con el servidor de opencod2; solo se achica.\n' |
| str opencod2_smoke.LAUNCHER |
| opencod2_smoke.RESULT = re.compile(r'^(ok |FAIL) (?P<name>.+?)( \(.*\))?$') |
| opencod2_smoke.ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| tuple opencod2_smoke.WINE_HEADER |