This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WL8400 Provide base repository, testing and tools
We store the version of MySQL Router in a special CMake module named version.cmake in the subfolder cmake/. It both has the version (as text) and version level. We add README.md as symbolic link to README.txt. The README.txt content is updated to use Markdown. We add external tools and make sure they are loaded when building MySQL Router. The CMake modules loading the external libraries and tools are located in the cmake subfolder. Tests are available which do basic checks whether the tools are loading OK. The cmake/settings.cmake files contains variables which configure how building is done. The CMake module is loaded in the root CMakeLists.txt. Each sub folder of the src-directory is a MySQL Router module. We load each module automatically using CMake function add_subdirectory. Each module is required to have at least a CMakeLists.txt and a sub-directory called 'include'. The src/ folder on it's own is loaded by the root CMakeLists.txt. We add the first module named 'router'. It holds the main application of MySQL Router and produces the binary 'mysqlrouter'. The name of the application can be configured in the cmake/settings.cmake file. We will use the Boost C++ Libraries and provide a special boost.cmake file which will discover the Boost headers. If Boost is not available or does not have the minimum required version, we show a error message and hint how to fix it. It is possible to provide CMake with options so Boost is downloaded or point where Boost is installed, for example: shell> cmake .. -DWITH_BOOST=/opt/boost shell> cmake .. -DWITH_BOOST=~/myboost \ -DDOWNLOAD_BOOST=YES Tests written in C/C++ and Python are automatically added from the subdirectories of the tests folder and added . Tests can be run like this: shell> mkdir build shell> cd build shell> cmake .. -DENABLE_TESTS=YES shell> make shell> make test Building of tests is disabled by default. To enable testing, use the option ENABLE_TESTS: shell> cmake .. -DENABLE_TESTS=YES The README.txt contains further information on how to run tests. We add a Python unit tests script copyright.py which checks the copyright notice in all files in the MySQL Router source repository. Files and folders can be ignored as well as file extensions. See the class TestCopyright members _ingore_files, _ignore_folders and _ignore_file_ext. The location of MySQL Router source can be provided using the command line --cmake-source-dir or as environment variable CMAKE_SOURCE_DIR. To run individual Python test script, do the following: shell> PYTHONPATH="." python tests/legal/copyright.py We test whether the license is mentioned in each relevant file such as C/C++, Python and CMake files. The FOSS exception and GPL disclaimer text in the README.txt is also checked. We test the name of the project in various places such as the README.txt and cmake/settings.cmake. Additionally, since MySQL Router is part of MySQL Fabric, we make sure there is a clause telling so in the README.txt file. The 'partof'-clause is configurable in cmake/settings.cmake.
- Loading branch information