git-svn-id: https://xournal.svn.sourceforge.net/svnroot/xournal/trunk/xournalpp@110 9fe2bcd3-a095-4d8b-a836-9b85dc8d7627
parent
84e006615b
commit
b6cdb7f839
30 changed files with 307 additions and 45 deletions
@ -1,9 +1,43 @@ |
||||
import xournal |
||||
import undo.UndoRedoTest |
||||
import os |
||||
|
||||
def xournalTest(): |
||||
print 'Testmethode' |
||||
def xournalTest(args = ''): |
||||
print 'Xournal testsuit started...' |
||||
|
||||
xoj = xournal.Xournal() |
||||
|
||||
xournalRunTestInSubfolder(xoj, 'tools'); |
||||
xournalRunTestInSubfolder(xoj, 'undo'); |
||||
|
||||
|
||||
def xournalRunTestInSubfolder(xoj, subfolder): |
||||
path = os.path.realpath(__file__) |
||||
path = os.path.dirname(path) |
||||
folder = os.path.join(path, subfolder) |
||||
|
||||
print 'Running scripts in %s' % folder |
||||
|
||||
for name in os.listdir(folder): |
||||
dirfile = os.path.join(folder, name) |
||||
|
||||
if os.path.isdir(dirfile) and not name.startswith('.') and os.path.exists(os.path.join(dirfile, 'Test.py')): |
||||
print 'Run test in %s' % dirfile |
||||
print 'Debug: import %s from %s' % (name, subfolder + '.' + name + '.Test') |
||||
__import__(subfolder + '.' + name + '.Test', fromlist = name) |
||||
cls = globals()[name] |
||||
inst = cls() |
||||
inst. |
||||
|
||||
|
||||
|
||||
# print xoj.openFile('/home/andreas/tmp/Notiz-10-03-2011-16-57.xoj') |
||||
|
||||
""" xoj.mousePressed(10, 10) |
||||
xoj.mouseMoved(20, 20) |
||||
xoj.mouseReleased() |
||||
|
||||
ud = ColorUndoAction() |
||||
""" |
||||
|
||||
print xoj.openFile('/home/andreas/tmp/Notiz-10-03-2011-16-57.xoj') |
||||
|
||||
|
||||
@ -0,0 +1,16 @@ |
||||
# Xournal++ |
||||
# |
||||
# Testclass for Undo / Redohandler |
||||
# |
||||
# @author Xournal Team |
||||
# http://xournal.sf.net |
||||
# |
||||
# @license GPL |
||||
|
||||
from undo.UndoRedoTest import UndoRedoTest |
||||
|
||||
class ColorUndoAction(UndoRedoTest): |
||||
def __init__(self): |
||||
UndoRedoTest.__init__(self) |
||||
print 'ColorUndoAction' |
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,17 @@ |
||||
# Xournal++ |
||||
# |
||||
# Textclass for Undo / Redohandler |
||||
# |
||||
# @author Xournal Team |
||||
# http://xournal.sf.net |
||||
# |
||||
# @license GPL |
||||
|
||||
|
||||
class UndoRedoTest: |
||||
def __init__(self): |
||||
print 'UndoRedoTest\n' |
||||
|
||||
def runTest(self): |
||||
print 'run test called!\n' |
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue