diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..996a43e12 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,19 @@ +language: python +python: + - "2.7" + - "3.2" +virtualenv: + system_site_packages: true +before_install: + - sudo apt-get update + - sudo apt-get install -qq python-pyside --fix-missing + - sudo apt-get install -qq python-qt4 --fix-missing + - sudo apt-get install -qq python3-pyside --fix-missing + - sudo apt-get install -qq python3-pyqt4 --fix-missing + - "export DISPLAY=:99.0" + - "sh -e /etc/init.d/xvfb start" +before_script: + - cd example +script: + - python example_pyqt.py --travis + - python example_pyside.py --travis \ No newline at end of file diff --git a/example/example_pyqt.py b/example/example_pyqt.py index 917e23415..2d1f7ec7a 100755 --- a/example/example_pyqt.py +++ b/example/example_pyqt.py @@ -37,7 +37,7 @@ Requirements: """ import sys -from PyQt4 import QtGui +from PyQt4 import QtGui, QtCore from os.path import abspath, dirname # make the example runnable without the need to install sys.path.insert(0, abspath(dirname(abspath(__file__)) + '/..')) @@ -61,6 +61,10 @@ def main(): # setup stylesheet app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=False)) + # auto quit after 2s when testing on travis-ci + if "--travis" in sys.argv: + QtCore.QTimer.singleShot(2000, app.exit) + # run window.show() app.exec_() diff --git a/example/example_pyside.py b/example/example_pyside.py index a1fb173e6..7a25ea399 100755 --- a/example/example_pyside.py +++ b/example/example_pyside.py @@ -36,9 +36,8 @@ Requirements: the example """ -import os import sys -from PySide import QtGui +from PySide import QtGui, QtCore from os.path import abspath, dirname # make the example runnable without the need to install sys.path.insert(0, abspath(dirname(abspath(__file__)) + '/..')) @@ -62,6 +61,10 @@ def main(): # setup stylesheet app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=True)) + # auto quit after 2s when testing on travis-ci + if "--travis" in sys.argv: + QtCore.QTimer.singleShot(2000, app.exit) + # run window.show() app.exec_()