config: add ENTT_VERSION
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
#ifndef ENTT_CONFIG_VERSION_H
|
||||
#define ENTT_CONFIG_VERSION_H
|
||||
|
||||
#include "macro.h"
|
||||
|
||||
#define ENTT_VERSION_MAJOR 3
|
||||
#define ENTT_VERSION_MINOR 10
|
||||
#define ENTT_VERSION_PATCH 0
|
||||
|
||||
#define ENTT_VERSION \
|
||||
ENTT_XSTR(ENTT_VERSION_MAJOR) \
|
||||
"." ENTT_XSTR(ENTT_VERSION_MINOR) "." ENTT_XSTR(ENTT_VERSION_PATCH)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -174,6 +174,10 @@ if(ENTT_BUILD_SNAPSHOT)
|
||||
target_include_directories(cereal PRIVATE ${cereal_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
# Test config
|
||||
|
||||
SETUP_BASIC_TEST(version entt/config/version.cpp)
|
||||
|
||||
# Test container
|
||||
|
||||
SETUP_BASIC_TEST(dense_map entt/container/dense_map.cpp)
|
||||
|
||||
8
test/entt/config/version.cpp
Normal file
8
test/entt/config/version.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <regex>
|
||||
#include <gtest/gtest.h>
|
||||
#include <entt/config/version.h>
|
||||
|
||||
TEST(Version, All) {
|
||||
ASSERT_STREQ(ENTT_VERSION, ENTT_XSTR(ENTT_VERSION_MAJOR) "." ENTT_XSTR(ENTT_VERSION_MINOR) "." ENTT_XSTR(ENTT_VERSION_PATCH));
|
||||
ASSERT_TRUE(std::regex_match(ENTT_VERSION, std::regex{"^[0-9]+\\.[0-9]+\\.[0-9]+$"}));
|
||||
}
|
||||
Reference in New Issue
Block a user