• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

examples/H18-Jul-2020-2,3621,709

LexillaAccess.cxxH A D31-May-20202.1 KiB9670

LexillaAccess.hH A D02-Jan-2020367 102

READMEH A D02-Jan-20202.5 KiB6646

TestDocument.cxxH A D15-Jan-20206.7 KiB247190

TestDocument.hH A D02-Jan-20202.2 KiB4434

TestLexers.cxxH A D23-Apr-20206.8 KiB242205

TestLexers.vcxprojH A D15-Jan-20208.7 KiB176176

makefileH A D02-Jan-20201.6 KiB6941

testlexers.makH A D02-Jan-2020795 4128

README

1README for testing lexers with lexilla/test.
2
3The TestLexers application is run to test the lexing of a set of example files
4and thus ensure that the lexers are working correctly.
5
6Lexers are accessed through the Lexilla shared library which must be built first
7in the lexilla/src directory.
8
9TestLexers works on Windows, Linux, or macOS and requires a C++20 compiler.
10MSVC 2019.4, GCC 9.0, Clang 9.0, and Apple Clang 11.0 are known to work.
11
12MSVC is only available on Windows.
13
14GCC and Clang work on Windows and Linux.
15
16On macOS, only Apple Clang is available.
17
18To use GCC run lexilla/test/makefile:
19	make test
20
21To use Clang run lexilla/test/makefile:
22	make CLANG=1 test
23On macOS, CLANG is set automatically so this can just be
24	make test
25
26To use MSVC:
27	nmake -f testlexers.mak test
28There is also a project file TestLexers.vcxproj that can be loaded into the Visual
29C++ IDE.
30
31
32
33Adding or Changing Tests
34
35The lexilla/test/examples directory contains a set of tests located in a tree of
36subdirectories.
37
38Each directory contains example files along with control files called
39SciTE.properties and expected result files with a .styled suffix.
40If an unexpected result occurs then files with the suffix .new may be created.
41
42Each file in the examples tree that does not have an extension of .properties, .styled, or
43.new is an example file that will be lexed according to settings found in SciTE.properties.
44The results of the lex will be compared to the corresponding .styled file and if different
45the result will be saved to a .new file for checking.
46So, if x.cxx is the example, its lexed form will be checked against x.cxx.styled and a
47x.cxx.new file may be created. The .new and .styled files contain the text of the original
48file along with style number changes in {} like:
49	{5}function{0} {11}first{10}(){0}
50After checking that the .new file is correct, it can be promoted to .styled and committed
51to the repository.
52
53The SciTE.properties file is similar to properties files used for SciTE but are simpler.
54The lexer to be run is defined with a lexer.{filepattern} statement like:
55	lexer.*.d=d
56
57Keywords may be defined with keywords settings like:
58	keywords.*.cxx=int char
59	keywords2.*.cxx=open
60
61Other settings are treated as lexer properties and forwarded to the lexer:
62	lexer.cpp.track.preprocessor=1
63
64If there is a need to test additional configurations of keywords or properties then
65create another subdirectory with the different settings in a new SciTE.properties.
66