diff options
| -rw-r--r-- | doc/ScintillaHistory.html | 1 | ||||
| -rw-r--r-- | test/README | 11 | ||||
| -rw-r--r-- | test/XiteQt.py | 101 | ||||
| -rw-r--r-- | test/performanceTests.py | 5 | ||||
| -rw-r--r-- | test/simpleTests.py | 5 | 
5 files changed, 5 insertions, 118 deletions
| diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 91e989da7..0cb250da5 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -578,6 +578,7 @@  	ScintillaEditPy, Python bindings for Qt using PySide, has been removed.  	Scintilla was never updated for PySide 2 which was released in 2018 and PySide 1  	fell out of support making it difficult to use. +	Tests that use ScintillaEditPy were removed.  	</li>  	<li>  	When calling SCI_GETTEXT, SCI_GETSELTEXT, and SCI_GETCURLINE with a NULL buffer argument diff --git a/test/README b/test/README index 53bfb7caa..740ab3470 100644 --- a/test/README +++ b/test/README @@ -1,8 +1,9 @@  The test directory contains some unit and performance tests for Scintilla. -The tests can only be run on Windows or Linux/Qt using Python 2.7 or 3.x. +The tests can only be run on Windows using Python 2.7 or 3.x.  Python 2.7+ is required because the bytes string type and literals are available.  Scintilla must be built before running any tests. +Lexilla may be built before running tests but lexing tests will be skipped if Lexilla not available.  A test application for Windows only is in xite.py and this can be run to experiment:  pythonw xite.py @@ -10,14 +11,6 @@ pythonw xite.py  To run the basic tests:  python simpleTests.py -There are some lexing tests with simple input files in several languages in the examples -subdirectory and their expected lexed states in *.styled where the start of each style -is marked with {styleNumber}, for example: -{15}<%@{16}language=javas{15}%>{0} - -To run the lexing tests: -python lexTests.py -  To check for performance regressions:  python performanceTests.py  While each test run will be different and the timer has only limited granularity, some results diff --git a/test/XiteQt.py b/test/XiteQt.py deleted file mode 100644 index e91829ad0..000000000 --- a/test/XiteQt.py +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env python2 -# -*- coding: utf-8 -*- -# Requires Python 2.7 or later - -import ctypes, os, platform, sys, unittest - -from PySide.QtCore import * -from PySide.QtGui import * - -import ScintillaCallable - -sys.path.append("..") -from bin import ScintillaEditPy - -scintillaDirectory = ".." -scintillaIncludeDirectory = os.path.join(scintillaDirectory, "include") -scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts") -sys.path.append(scintillaScriptsDirectory) -import Face - -scintillaIncludesLexers = False -# Lexilla may optionally be tested it is built and can be loaded -lexillaAvailable = False - -lexillaDirectory = os.path.join(scintillaDirectory, "..", "lexilla") -lexillaBinDirectory = os.path.join(lexillaDirectory, "bin") -lexillaIncludeDirectory = os.path.join(lexillaDirectory, "include") - -lexName = "liblexilla.so" -try: -	lexillaSOPath = os.path.join(lexillaBinDirectory, lexName) -	lexillaLibrary = ctypes.cdll.LoadLibrary(lexillaSOPath) -	createLexer = lexillaLibrary.CreateLexer -	createLexer.restype = ctypes.c_void_p -	lexillaAvailable = True -	print("Found Lexilla") -except OSError: -	print("Can't find " + lexName) -	print("Python is built for " + " ".join(platform.architecture())) - -class Form(QDialog): - -	def __init__(self, parent=None): -		super(Form, self).__init__(parent) -		self.resize(460,300) -		# Create widget -		self.edit = ScintillaEditPy.ScintillaEdit(self) - -class XiteWin(): -	def __init__(self, test=""): -		self.face = Face.Face() -		self.face.ReadFromFile(os.path.join(scintillaIncludeDirectory, "Scintilla.iface")) -		try: -			faceLex = Face.Face() -			faceLex.ReadFromFile(os.path.join(lexillaIncludeDirectory, "LexicalStyles.iface")) -			self.face.features.update(faceLex.features) -		except FileNotFoundError: -			print("Can't find " + "LexicalStyles.iface") - -		self.test = test - -		self.form = Form() - -		scifn = self.form.edit.send(int(self.face.features["GetDirectFunction"]["Value"]), 0, 0) -		sciptr = ctypes.c_char_p(self.form.edit.send( -			int(self.face.features["GetDirectPointer"]["Value"]), 0,0)) - -		self.ed = ScintillaCallable.ScintillaCallable(self.face, scifn, sciptr) -		self.form.show() - -	def DoStuff(self): -		print(self.test) -		self.CmdTest() - -	def DoEvents(self): -		QApplication.processEvents() - -	def CmdTest(self): -		runner = unittest.TextTestRunner() -		tests = unittest.defaultTestLoader.loadTestsFromName(self.test) -		results = runner.run(tests) -		print(results) -		sys.exit(0) - -	def ChooseLexer(self, lexer): -		if scintillaIncludesLexers: -			self.ed.LexerLanguage = lexer -		elif lexillaAvailable: -			pLexilla = createLexer(lexer) -			self.ed.SetILexer(0, pLexilla) -		else:	# No lexers available -			pass - -xiteFrame = None - -def main(test): -	global xiteFrame -	app = QApplication(sys.argv) -	xiteFrame = XiteWin(test) -	xiteFrame.DoStuff() -	sys.exit(app.exec_()) diff --git a/test/performanceTests.py b/test/performanceTests.py index 435e0e508..eb7c0c096 100644 --- a/test/performanceTests.py +++ b/test/performanceTests.py @@ -13,10 +13,7 @@ try:  except AttributeError:  	timer = time.time -if sys.platform == "win32": -	import XiteWin as Xite -else: -	import XiteQt as Xite +import XiteWin as Xite  class TestPerformance(unittest.TestCase): diff --git a/test/simpleTests.py b/test/simpleTests.py index 71c35e8d0..98ae2a3af 100644 --- a/test/simpleTests.py +++ b/test/simpleTests.py @@ -7,10 +7,7 @@ from __future__ import unicode_literals  import ctypes, string, sys, unittest -if sys.platform == "win32": -	import XiteWin as Xite -else: -	import XiteQt as Xite +import XiteWin as Xite  # Unicode line ends are only available for lexers that support the feature so requires lexers  lexersAvailable = Xite.lexillaAvailable or Xite.scintillaIncludesLexers | 
