[cmake-developers] Python bindings for CTest
Jonathan R. Madsen
jrmadsen at lbl.gov
Fri Oct 19 11:16:44 EDT 2018
Inline below.
--
Jonathan
> On Oct 19, 2018, at 6:19 AM, Brad King <brad.king at kitware.com> wrote:
>
>> On 10/18/2018 11:22 PM, Jonathan R. Madsen wrote:
>> I have created some Python bindings for CTest. The goal was to
>> create an easy way for Python projects that I work with to be able
>> to wrap their Python compilation log (if there was one), dynamically
>> generate CTests and/or wrap their existing testing commands, do any
>> additional testing analysis (in Python), etc. and then submit the
>> logs, notes, plots, etc. to CDash without requiring them to overhaul
>> any of their existing build or testing systems.
>>
>> Is there any interest in this development?
>
> Neat. Have you published these anywhere?
>
Yes it is currently available at https://github.com/jrmadsen/pyctest.
The 'conda-fixes' branch is what I've been working on most recently but I hasn't diverged much outside of the examples. This is a good example of how the driver works:
https://github.com/jrmadsen/pyctest/blob/conda-fixes/examples/TomoPy/pyctest_tomopy.py
> Does this make modifications to CTest itself,
It does not modify CTestLib or CMakeLib in any substantial way. I had to reimplement some classes to bypass some expectations -- such as the expections for actual files -- but when that was required I prefixed the new/alternative implementation with "py" (e.g. cmConfigureFileCommand became pycmConfigureFileCommand).
> or is this all
> going through CTestTestfile.cmake generation?
I'm not 100% sure what you are asking here. For the most part, I let y'all's library do all the work. For example, the Python version of cmTest (pycmTest) uses cmPropertyMap and the Python version of cmTestGenerator (pycmTestGenerator) inherits from cmScriptGenerator. I believe this to be a far less error-prone method than just creating a Python package that "knows the syntax" and writes files for CMake/CTest.
> I don't think we
> can have "ctest" itself link to python libraries.
>
Nothing on the CMake side has any dependencies on python libraries as a result of this. I just include header files and link to y'all's library like one does with any other API.
> Thanks,
> -Brad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake-developers/attachments/20181019/010196b3/attachment.html>
More information about the cmake-developers
mailing list