GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: bindings/python/utils/version.cpp Lines: 10 10 100.0 %
Date: 2024-04-26 13:14:21 Branches: 6 16 37.5 %

Line Branch Exec Source
1
//
2
// Copyright (c) 2018 CNRS, INRIA
3
//
4
5
#include "pinocchio/bindings/python/utils/constant.hpp"
6
#include "pinocchio/bindings/python/utils/version.hpp"
7
#include "pinocchio/utils/version.hpp"
8
9
#include <boost/python.hpp>
10
11
namespace pinocchio
12
{
13
  namespace python
14
  {
15
16
    namespace bp = boost::python;
17
18

38
    BOOST_PYTHON_FUNCTION_OVERLOADS(printVersion_overload, printVersion, 0, 1)
19
20
19
    void exposeVersion()
21
    {
22
      // Define release numbers of the current Pinocchio version.
23
19
      bp::def_constant("PINOCCHIO_MAJOR_VERSION",PINOCCHIO_MAJOR_VERSION);
24
19
      bp::def_constant("PINOCCHIO_MINOR_VERSION",PINOCCHIO_MINOR_VERSION);
25
19
      bp::def_constant("PINOCCHIO_PATCH_VERSION",PINOCCHIO_PATCH_VERSION);
26
27
19
      bp::def("printVersion",printVersion,
28
38
              printVersion_overload(bp::arg("delimiter"),
29
                                    "Returns the current version of Pinocchio as a string.\n"
30
                                    "The user may specify the delimiter between the different semantic numbers.")
31
              );
32
33
19
      bp::def("checkVersionAtLeast",&checkVersionAtLeast,
34
38
              bp::args("major","minor","patch"),
35
              "Checks if the current version of Pinocchio is at least"
36
              " the version provided by the input arguments.");
37
19
    }
38
39
  } // namespace python
40
} // namespace pinocchio