Skip to content

Build and perform the tests for all Python versions (Major change)

Ammar Nejati requested to merge multipythonTests into develop2

The unit and functional tests, as well as the example tests, can be built for all Python versions; i.e., the main version and the Python versions set via BORNAGAIN_PYTHON_PACKAGE_VERSIONS variable.

The tests for the extra Python versions are built by setting the variable BORNAGAIN_PYTHON_PACKAGE_TESTS=ON.

  • A tests subfolder is added to the main binary directory to to store the built tests for the main version and their output.

  • A tests subfolder is added to the build directory for Python packages to store the built tests and their output.

  • Adapted unit and functional tests for multiple Python versions.
    NOTE:

    • Functional/PyEmbedded test still cannot be performed for the Python packages, most probably due to a problem with proper usage of the Python C/API. Currently, it is produced only for the main version.
    • The GUI test is performed only for the main version, since the Python packages does not include a GUI.
  • A new CMake module MakePythonAPI is introduced to produce the Python interfaces to the C++ libraries. MakePythonAPI includes the necessary CMake code to build the Python interfaces and Python packages (via MakeSwigLib and MakePythonWheel modules). In this way, the Python-related part of the build mechanism is enclosed in MakePythonAPI.

  • Differentiated between BORNAGAIN_PYTHON variable and WITH_PYTHON_API argument:

    • BORNAGAIN_PYTHON = Add Python-related functionality to the C++ libraries.
    • WITH_PYTHON_API = Add a Python interface to the C++ libraries; currently made with SWIG.
  • Adapted CMakeLists.txt for all modules (Base, Fit, etc.) to the new interface of MakeSharedLib.

  • GUI:

    • SampleListView: Added proper preprocessor guards for BORNAGAIN_PYTHON.
    • Improved and cleaned up CMakeLists.txt.
    • Test: Minor improvements.
Edited by Ammar Nejati

Merge request reports

Loading