Skip to content

Commit e305a1c

Browse files
committed
[#529] Add runtime test for runtime version and fix clang-tidy warning
1 parent 87e92d5 commit e305a1c

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

compiler/extensions/cpp/runtime/ClangTidySuppressions.txt

+3
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ modernize-use-equals-default:src/zserio/Span.h:79
134134
# This is completely filtered out because it just would add two more lines making readability even worse.
135135
readability-braces-around-statements:
136136

137+
# This must be preprocessor define because version is checked during compilation time.
138+
cppcoreguidelines-macro-usage:src/zserio/CppRuntimeVersion.h:12
139+
137140
# Intentional tests.
138141
bugprone-use-after-move:test/zserio/HeapOptionalHolderTest.cpp:178
139142
bugprone-use-after-move:test/zserio/HeapOptionalHolderTest.cpp:199

compiler/extensions/cpp/runtime/test/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ set(ZSERIO_CPP_RUNTIME_TEST_SRCS
150150
zserio/BuiltInOperatorsTest.cpp
151151
zserio/ConstraintExceptionTest.cpp
152152
zserio/CppRuntimeExceptionTest.cpp
153+
zserio/CppRuntimeVersionTest.cpp
153154
zserio/DebugStringUtilTest.cpp
154155
zserio/EnumsTest.cpp
155156
zserio/FloatUtilTest.cpp
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include "zserio/CppRuntimeVersion.h"
2+
3+
#include "gtest/gtest.h"
4+
5+
TEST(CppRuntimeVersionTest, checkVersion)
6+
{
7+
#if CPP_EXTENSION_RUNTIME_VERSION_NUMBER < 2011000
8+
#error Zserio runtime library version is too old!
9+
#endif
10+
}

0 commit comments

Comments
 (0)