updates api version based on version file & converted shell script files to python

This commit is contained in:
mazzol_a
2025-05-15 16:35:09 +02:00
parent 0d5d851585
commit 3ad4e01a5d
14 changed files with 542 additions and 161 deletions

View File

@ -11,7 +11,7 @@ class Version {
private:
std::string version_;
std::string date_;
const std::string defaultBranch_ = "developer";
inline static const std::string defaultBranch_[] = {"developer", "0.0.0"};
public:
explicit Version(const std::string &s);

View File

@ -1,9 +1,9 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
/** API versions */
#define APILIB "developer 0x241122"
#define APIRECEIVER "developer 0x241122"
#define APICTB "developer 0x250310"
#define APILIB "0.0.0 0x250514"
#define APIRECEIVER "0.0.0 0x250515"
#define APICTB "0.0.0 0x250515"
#define APIGOTTHARD2 "developer 0x250310"
#define APIMOENCH "developer 0x250310"
#define APIEIGER "developer 0x250310"

View File

@ -21,7 +21,8 @@ Version::Version(const std::string &s) {
}
bool Version::hasSemanticVersioning() const {
return version_ != defaultBranch_;
return (version_ != defaultBranch_[0]) && (version_ != defaultBranch_[1]);
}
std::string Version::getVersion() const { return version_; }

View File

@ -14,6 +14,7 @@ target_sources(tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/test-TypeTraits.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-UdpRxSocket.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-logger.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-Version.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-ZmqSocket.cpp
)

View File

@ -0,0 +1,19 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include "catch.hpp"
#include "sls/Version.h"
namespace sls {
TEST_CASE("check if version is semantic", "[.version]") {
auto [version_string, has_semantic_version] =
GENERATE(std::make_tuple("developer 0x250512", false),
std::make_tuple("0.0.0 0x250512", false));
Version version(version_string);
CHECK(version.hasSemanticVersioning() == has_semantic_version);
}
} // namespace sls