Developers' side bar
Categories: Category Development<< | Page list | >>
How to run the test suite on Windows?
Have CMake and CTest: https://cmake.org/download/
Have Python (any distribution, Anaconda included): https://www.python.org/downloads/windows/
Have Perl (any distribution should work, Strawberry is often regarded as the best for Windows): http://strawberryperl.com/ (it has the required packages)
Open a prompt with all these tools available in the PATH; you may use a command like this to this end (check that these folders exist on your system!):
set PATH=C:\Strawberry\perl\bin;C:\Strawberry\c\bin;%USERPROFILE%\AppData\Local\Programs\Python\Python38;C:\Program Files\CMake\bin;%PATH%
On newer versions of Windows, the path to Python must be among the first ones. Indeed, Microsoft ships a fake binary in
If, once CMake is done compiling, you notice you made a mistake in one of these paths, CMake stores paths (like the one to Perl) in its cache (CMakeCache.txt). This means that you will have to reconfigure LyX completely to take into account the new path for Perl.
Compile LyX using CMake and this command prompt. This ensures that CMake and CTest will have access to the right version of Perl and Python (the paths to them are determined when launching CMake for configuring the project).
The details of compilation can be found in the
For specific tests like exports, they must be separately enabled with a flag like
Giving the right paths to CMake through CLion is not always an easy task. One way to achieve it is to modify LyX' root CMakeLists.txt (at the root of the Git repository) to add the relevant options:
set(CMAKE_CXX_STANDARD 20) set(GNUWIN32_DIR D:/LyX/lyx-unstable/lyx-windows-deps-msvc2017) set(LYX_USE_QT "QT5") set(LYX_ENABLE_EXPORT_TESTS 1) set(QT_DIR D:/Qt/5.15.0/msvc2019_64) set(QT5_DIR D:/Qt/5.15.0/msvc2019_64) set(QT_MKSPECS_DIR D:/Qt/5.15.0/msvc2019_64/mkspecs) set(Qt5Concurrent_DIR D:/Qt/5.15.0/msvc2019_64/lib/cmake/Qt5Concurrent) set(Qt5Core_DIR D:/Qt/5.15.0/msvc2019_64/lib/cmake/Qt5Core) set(Qt5Gui_DIR D:/Qt/5.15.0/msvc2019_64/lib/cmake/Qt5Gui) set(Qt5Svg_DIR D:/Qt/5.15.0/msvc2019_64/lib/cmake/Qt5Svg) set(Qt5Widgets_DIR D:/Qt/5.15.0/msvc2019_64/lib/cmake/Qt5Widgets) set(Qt5WinExtras_DIR D:/Qt/5.15.0/msvc2019_64/lib/cmake/Qt5WinExtras) LIST(PREPEND CMAKE_PROGRAM_PATH "C:/Strawberry/perl/bin") LIST(PREPEND CMAKE_PROGRAM_PATH "C:/Strawberry/c/bin") LIST(PREPEND CMAKE_PROGRAM_PATH "C:/Users/YOUR_USER_NAME/AppData/Local/Programs/Python/Python38") set(PERL_EXECUTABLE "C:/Strawberry/perl/bin/perl.exe")
Running the tests
Using the same command prompt, go into the folder where CMake built LyX (typically,
ctest Run all tests ctest -R export Run all export tests ctest -j4 Run all tests on four cores
Category: Category Development