2015-07-12 16:46:12 +00:00
|
|
|
import sys, os
|
|
|
|
import pyqtgraph as pg
|
|
|
|
|
2012-12-26 22:51:52 +00:00
|
|
|
|
2013-07-03 21:52:16 +00:00
|
|
|
if __name__ == "__main__" and (__package__ is None or __package__==''):
|
|
|
|
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
sys.path.insert(0, parent_dir)
|
|
|
|
import examples
|
|
|
|
__package__ = "examples"
|
2013-04-29 12:13:28 +00:00
|
|
|
|
2015-07-12 16:46:12 +00:00
|
|
|
from .utils import buildFileList, testFile, run, path
|
2012-11-29 21:50:42 +00:00
|
|
|
|
2012-03-02 02:55:32 +00:00
|
|
|
if __name__ == '__main__':
|
2015-07-12 16:46:12 +00:00
|
|
|
|
2015-02-28 16:05:57 +00:00
|
|
|
args = sys.argv[1:]
|
|
|
|
|
|
|
|
if '--test' in args:
|
2014-03-05 15:34:46 +00:00
|
|
|
# get rid of orphaned cache files first
|
|
|
|
pg.renamePyc(path)
|
2015-02-28 16:05:57 +00:00
|
|
|
|
2012-11-29 21:50:42 +00:00
|
|
|
files = buildFileList(examples)
|
2015-02-28 16:05:57 +00:00
|
|
|
if '--pyside' in args:
|
2012-12-05 05:25:45 +00:00
|
|
|
lib = 'PySide'
|
2015-02-28 16:05:57 +00:00
|
|
|
elif '--pyqt' in args or '--pyqt4' in args:
|
2012-12-05 05:25:45 +00:00
|
|
|
lib = 'PyQt4'
|
2015-02-28 16:05:57 +00:00
|
|
|
elif '--pyqt5' in args:
|
|
|
|
lib = 'PyQt5'
|
2012-12-05 05:25:45 +00:00
|
|
|
else:
|
|
|
|
lib = ''
|
|
|
|
|
|
|
|
exe = sys.executable
|
|
|
|
print("Running tests:", lib, sys.executable)
|
2012-11-29 21:50:42 +00:00
|
|
|
for f in files:
|
2012-12-05 05:25:45 +00:00
|
|
|
testFile(f[0], f[1], exe, lib)
|
2012-11-29 21:50:42 +00:00
|
|
|
else:
|
|
|
|
run()
|