Skip to content

Commit

Permalink
github: Run openomf with null renderer and audio backends
Browse files Browse the repository at this point in the history
  • Loading branch information
mrannanj committed Dec 2, 2024
1 parent 6add65e commit 6c2ff34
Show file tree
Hide file tree
Showing 6 changed files with 227 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,43 @@ jobs:
cd build-test
ctest --verbose --output-on-failure
- name: Restore omf2097-assets.zip
id: cache-assets
uses: actions/cache/restore@v4
with:
path: omf2097-assets.zip
key: omf2097-assets.zip

- name: Download omf 2097 assets
if: steps.cache-assets.outputs.cache-hit != 'true'
run: wget -q "${{ env.OPENOMF_ASSETS_URL }}"

- name: Cache omf2097-assets.zip
if: steps.cache-assets.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: omf2097-assets.zip
key: omf2097-assets.zip

- name: Extract omf 2097 assets
run: unzip -j omf2097-assets.zip -d build-test/resources

- name: Install pytest requirements
run: |
pipx install poetry
cd pytest
poetry install
- name: Run pytest tests
run: poetry run pytest -vrP pytest

#- name: Run openomf with null output
#run: |
#cd build-test
#echo "quit" | ./Debug/openomf --force-renderer NULL --force-audio-backend NULL
#env:
#LSAN_OPTIONS: suppressions=../lsan.supp

# Build windows release artifacts with MSVC
# -----------------------------------------------------------------------------------------------
build_msvc:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ cmake-build-debug/
cmake-build-release/
.cache
compile_commands.json
__pycache__
*.pyc
5 changes: 5 additions & 0 deletions lsan.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# libconfuse
leak:libconfuse

# SDL leak
leak:has_gl_available
156 changes: 156 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[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"
15 changes: 15 additions & 0 deletions pytest/test_menus.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import sys
import os
from pexpect import popen_spawn, EOF

# FIXME: paths, input, fixture, etc
def test_quit():
lsan_env = os.environ
lsan_env["LSAN_OPTIONS"] = "suppressions=../lsan.supp"
p = popen_spawn.PopenSpawn(["./Debug/openomf", "--force-renderer",
"NULL", "--force-audio-backend", "NULL"],
timeout=60, cwd="build-test",
encoding='utf-8', logfile=sys.stdout,
env=lsan_env)
p.sendline("quit")
p.expect(EOF, timeout=60)

0 comments on commit 6c2ff34

Please sign in to comment.