Directory: | ./ |
---|---|
File: | bindings/python/utils/version.cpp |
Date: | 2024-08-27 18:20:05 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 9 | 9 | 100.0% |
Branches: | 6 | 12 | 50.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | // | ||
2 | // Copyright (c) 2018-2021 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 | 20 | void exposeVersion() | |
19 | { | ||
20 | // Define release numbers of the current Pinocchio version. | ||
21 |
1/2✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
|
20 | bp::def_constant("PINOCCHIO_MAJOR_VERSION", PINOCCHIO_MAJOR_VERSION); |
22 |
1/2✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
|
20 | bp::def_constant("PINOCCHIO_MINOR_VERSION", PINOCCHIO_MINOR_VERSION); |
23 |
1/2✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
|
20 | bp::def_constant("PINOCCHIO_PATCH_VERSION", PINOCCHIO_PATCH_VERSION); |
24 | |||
25 | 20 | bp::def( | |
26 |
2/4✓ Branch 2 taken 20 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 20 times.
✗ Branch 6 not taken.
|
20 | "printVersion", printVersion, (bp::arg("delimiter") = "."), |
27 | "Returns the current version of Pinocchio as a string.\n" | ||
28 | "The user may specify the delimiter between the different semantic numbers."); | ||
29 | |||
30 |
1/2✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
|
20 | bp::def( |
31 | 40 | "checkVersionAtLeast", &checkVersionAtLeast, bp::args("major", "minor", "patch"), | |
32 | "Checks if the current version of Pinocchio is at least" | ||
33 | " the version provided by the input arguments."); | ||
34 | 20 | } | |
35 | |||
36 | } // namespace python | ||
37 | } // namespace pinocchio | ||
38 |