-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
226 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,5 @@ cmake-build-debug/ | |
cmake-build-release/ | ||
.cache | ||
compile_commands.json | ||
__pycache__ | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# libconfuse | ||
leak:libconfuse | ||
|
||
# SDL leak | ||
leak:has_gl_available |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[tool.poetry] | ||
package-mode = false | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.10" | ||
pytest = "^8.3" | ||
pexpect = "^4.9.0" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import sys | ||
import os | ||
import time | ||
from pexpect import popen_spawn, EOF | ||
from contextlib import contextmanager | ||
|
||
|
||
@contextmanager | ||
def start_openomf(): | ||
lsan_env = os.environ | ||
lsan_env["LSAN_OPTIONS"] = "suppressions=../lsan.supp" | ||
openomf_bin = os.environ["OPENOMF_BIN"] | ||
build_dir = os.environ["BUILD_DIR"] | ||
p = popen_spawn.PopenSpawn([openomf_bin, "--force-renderer", "NULL", | ||
"--force-audio-backend", "NULL"], | ||
timeout=60, cwd=build_dir, encoding='utf-8', | ||
logfile=sys.stdout, env=lsan_env) | ||
try: | ||
yield p | ||
finally: | ||
p.wait() | ||
|
||
|
||
def test_tournament_menu(): | ||
with start_openomf() as p: | ||
time.sleep(1) | ||
p.sendline("scene SCENE_MENU") | ||
p.expect("Loaded scene SCENE_MENU", timeout=180) | ||
time.sleep(1) | ||
p.sendline("scene SCENE_MECHLAB") | ||
p.expect("Loaded scene SCENE_MECHLAB", timeout=180) | ||
time.sleep(1) | ||
p.sendline("quit") | ||
p.expect(EOF, timeout=180) | ||
|
||
|
||
def test_quit(): | ||
with start_openomf() as p: | ||
time.sleep(1) | ||
p.sendline("quit") | ||
p.expect(EOF, timeout=60) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -z "$2" ]; then | ||
echo "Usage: $0 <build-dir> <openomf-executable>" >&2 | ||
exit 1 | ||
fi | ||
|
||
export BUILD_DIR="$1" | ||
export OPENOMF_BIN="$2" | ||
|
||
exec poetry run pytest -vrP pytest |