xair-api-python/scripts.py

36 lines
769 B
Python
Raw Normal View History

import os
2022-11-07 15:23:20 +00:00
import subprocess
import sys
2022-11-07 15:23:20 +00:00
from pathlib import Path
2022-11-07 20:06:56 +00:00
def ex_obs():
subprocess.run(['tox', 'r', '-e', 'obs'])
2022-11-07 20:06:56 +00:00
def ex_sends():
path = Path.cwd() / 'examples' / 'sends' / '.'
subprocess.run([sys.executable, str(path)])
def ex_headamp():
path = Path.cwd() / 'examples' / 'headamp' / '.'
subprocess.run([sys.executable, str(path)])
2022-11-07 15:23:20 +00:00
def test_xair():
subprocess.run(['tox'], env=os.environ.copy() | {'TEST_MODULE': 'xair'})
2022-11-07 15:23:20 +00:00
def test_x32():
path = Path.cwd() / 'tools' / 'x32.exe'
proc = subprocess.Popen([str(path), '-i', 'x32.local'])
subprocess.run(['tox'], env=os.environ.copy() | {'TEST_MODULE': 'x32'})
proc.terminate()
2024-02-15 23:54:31 +00:00
def test_all():
steps = [test_xair, test_x32]
for step in steps:
step()