Use xvfb only on Linux with xvfbwrapper
This commit is contained in:
parent
6f9b66ddff
commit
d7cc8b112e
|
@ -18,5 +18,5 @@ install:
|
||||||
- export PYTHONWARNINGS=all
|
- export PYTHONWARNINGS=all
|
||||||
script:
|
script:
|
||||||
- python checkdeps.py
|
- python checkdeps.py
|
||||||
- xvfb-run src/bitmessagemain.py -t
|
- python src/bitmessagemain.py -t
|
||||||
- python -bm tests
|
- python -bm tests
|
||||||
|
|
|
@ -2,3 +2,4 @@ coverage
|
||||||
python_prctl
|
python_prctl
|
||||||
psutil
|
psutil
|
||||||
pycrypto
|
pycrypto
|
||||||
|
xvfbwrapper;platform_system=="Linux"
|
||||||
|
|
|
@ -3,6 +3,7 @@ Tests for core and those that do not work outside
|
||||||
(because of import error for example)
|
(because of import error for example)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import atexit
|
||||||
import os
|
import os
|
||||||
import pickle # nosec
|
import pickle # nosec
|
||||||
import Queue
|
import Queue
|
||||||
|
@ -398,8 +399,9 @@ def run():
|
||||||
suite = loader.loadTestsFromTestCase(TestCore)
|
suite = loader.loadTestsFromTestCase(TestCore)
|
||||||
try:
|
try:
|
||||||
import bitmessageqt.tests
|
import bitmessageqt.tests
|
||||||
|
from xvfbwrapper import Xvfb
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
Xvfb = None
|
||||||
else:
|
else:
|
||||||
qt_tests = loader.loadTestsFromModule(bitmessageqt.tests)
|
qt_tests = loader.loadTestsFromModule(bitmessageqt.tests)
|
||||||
suite.addTests(qt_tests)
|
suite.addTests(qt_tests)
|
||||||
|
@ -410,4 +412,8 @@ def run():
|
||||||
|
|
||||||
sys.excepthook = keep_exc
|
sys.excepthook = keep_exc
|
||||||
|
|
||||||
|
if Xvfb:
|
||||||
|
vdisplay = Xvfb(width=1024, height=768)
|
||||||
|
vdisplay.start()
|
||||||
|
atexit.register(vdisplay.stop)
|
||||||
return unittest.TextTestRunner(verbosity=2).run(suite)
|
return unittest.TextTestRunner(verbosity=2).run(suite)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user