]> git.lyx.org Git - features.git/blob - src/tests/CMakeLists.txt
Add test for Layout::write() on cmake too
[features.git] / src / tests / CMakeLists.txt
1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
3 #
4 # Copyright (c) 2013 Kornel Benko kornel@lyx.org
5 #
6
7 set(check_Layout_SOURCES)
8 foreach(_f insets/InsetLayout.cpp Color.cpp Counters.cpp Floating.cpp
9        FloatList.cpp FontInfo.cpp Layout.cpp LayoutFile.cpp Lexer.cpp
10        ModuleList.cpp Spacing.cpp TextClass.cpp tests/check_Layout.cpp
11        support/tests/boost.cpp support/tests/dummy_functions.cpp)
12   list(APPEND check_Layout_SOURCES "${TOP_SRC_DIR}/src/${_f}")
13 endforeach()
14
15 add_definitions(-DNO_LAYOUT_CSS)
16 add_executable(check_Layout ${check_Layout_SOURCES})
17 set(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -Wl,--allow-multiple-definition")
18 target_link_libraries(check_Layout support ${QT_QTMAIN_LIBRARY})
19 add_dependencies(lyx_run_tests check_Layout)
20
21 file(GLOB layout_files RELATIVE "${TOP_SRC_DIR}/lib/layouts" "${TOP_SRC_DIR}/lib/layouts/*.layout")
22 list(SORT layout_files)
23 foreach(bns ${layout_files}) 
24   string(REPLACE ".layout" "" bn ${bns})
25
26   add_test(NAME "check_Layout/${bns}"
27     COMMAND check_Layout "${TOP_SRC_DIR}/lib/layouts/${bn}")
28 endforeach()