chrono_batch_render/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
7 / 7
100.0%
Branches:
2 / 2
100.0%
Functions:
2 / 2
100.0%

util/version.cpp
Line Branch Exec Source
1 // SPDX-License-Identifier: BSD-3-Clause
2 #include "chrono_batch_render/util/version.h"
3
4 #include <fmt/format.h>
5
6 #include "build_info.h"
7
8 namespace chrono::batch_render {
9
10 55 std::string Version::ToString() const {
11
2/2
✓ Branch 0 taken 52 times.
✓ Branch 1 taken 3 times.
55 if (patch != 0) {
12 52 return fmt::format("{}.{}.{}", major, minor, patch);
13 }
14 3 return fmt::format("{}.{}", major, minor);
15 }
16
17 27 const BuildInfo& GetBuildInfo() {
18 27 static const BuildInfo info{{CHRONO_BATCH_RENDER_VERSION_MAJOR,
19 CHRONO_BATCH_RENDER_VERSION_MINOR,
20 CHRONO_BATCH_RENDER_VERSION_PATCH},
21 CHRONO_BATCH_RENDER_GIT_SHA,
22 CHRONO_BATCH_RENDER_GIT_DIRTY,
23 CHRONO_BATCH_RENDER_COMMIT_DATE,
24 CHRONO_BATCH_RENDER_BUILD_DATE,
25 CHRONO_BATCH_RENDER_VERSION_FULL};
26 27 return info;
27 }
28
29 }
30