Fix some build problems

This commit is contained in:
Robin Jadoul 2016-05-29 20:33:13 +02:00
parent ced7c7786f
commit 2864ba5a43
8 changed files with 25 additions and 8 deletions

View File

@ -51,11 +51,15 @@ This will place the Lexesis executable in the `build/bin` folder, with some extr
You can now simply run `./bin/Lexesis` with the arguments you like (see below and in the man pages for an overview).
### Running tests
First, build Lexesis in debug mode. The only difference with the normal building, is the line where you call cmake. That line should read
First, build Lexesis in debug mode. The first difference with the normal building, is the line where you call cmake. That line should read
cmake .. -DCMAKE_BUILD_TYPE=Debug
instead. Afterwards, build all the examples as well, since they are used to test the functionality of the generated lexers.
instead. Afterwards, after calling `make install`, build all the examples as well with
make examples
since they are used to test the functionality of the generated lexers.
If everything is correctly built, the only thing that remains is to call

View File

@ -1,4 +0,0 @@
cmake_minimum_required(VERSION 3.2.2)
project(cpp-optparse)
add_library(cpp-optparse OptionParser.cpp)

View File

@ -1,2 +1,4 @@
add_subdirectory(keywords)
add_subdirectory(SyntaxHighlighter)
add_custom_target(examples DEPENDS keywords highlighter)

View File

@ -1,4 +1,4 @@
find_program(LEXESIS_EXE Lexesis PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../build/bin")
find_program(LEXESIS_EXE Lexesis PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../build/bin")
add_custom_command(DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/xmllexer.lxs"
COMMAND ${LEXESIS_EXE} ARGS -d "${CMAKE_CURRENT_BINARY_DIR}" -n XMLLexer "${CMAKE_CURRENT_SOURCE_DIR}/src/xmllexer.lxs"
@ -14,6 +14,7 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}")
include_directories(include)
add_executable(highlighter
EXCLUDE_FROM_ALL
src/highlighter.cpp
src/main.cpp
"${CMAKE_CURRENT_BINARY_DIR}/AttributeLexer.cpp"

View File

@ -8,6 +8,7 @@ add_custom_command(DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/keywordsLexer.lxs"
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
add_executable(keywords
EXCLUDE_FROM_ALL
main.cpp
"${CMAKE_CURRENT_BINARY_DIR}/KeywordsLexer.cpp"
)

View File

@ -10,7 +10,7 @@ REGEXES_DATA = [ #TODO
]
EXAMPLE_TESTS = { #Mapping from test name to executable and number of available test input files
"keywords" : ("examples/keywords/keywords", 1),
"keywords" : ("examples/keywords/keywords", 2),
"highlighter": ("examples/SyntaxHighlighter/highlighter", 1),
}

12
tests/keywords_1.exp Normal file
View File

@ -0,0 +1,12 @@
MODULE: "Module"
MODULE: "module"
IDENT: "MODULE"
IDENT: "END"
END: "end"
END: "End"
IF: "if"
IDENT: "IF"
IF: "If"
IDENT: "something"
IDENT: "random"
DONE

1
tests/keywords_1.in Normal file
View File

@ -0,0 +1 @@
Module module MODULE END end End if IF If something random