Merge f008774edc into ab5f9259a4
This commit is contained in:
commit
bd2f01c9f6
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
build/
|
||||
test/version_test.cpp
|
||||
|
||||
17
include/yaml-cpp/version.h
Normal file
17
include/yaml-cpp/version.h
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef YAML_CPP_VERSION_H
|
||||
#define YAML_CPP_VERSION_H
|
||||
|
||||
#if defined(_MSC_VER) || \
|
||||
(defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
|
||||
(__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#define YAML_CPP_VERSION_MAJOR 0
|
||||
#define YAML_CPP_VERSION_MINOR 5
|
||||
#define YAML_CPP_VERSION_PATCH 2
|
||||
|
||||
// String representation of the current version (ie. "0.1.2")
|
||||
#define YAML_CPP_VERSION "0.5.2"
|
||||
|
||||
#endif // YAML_CPP_VERSION_H
|
||||
@ -23,6 +23,9 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Create version_test.cpp
|
||||
configure_file(${YAML_CPP_SOURCE_DIR}/test/version_test.cpp.in ${YAML_CPP_SOURCE_DIR}/test/version_test.cpp)
|
||||
|
||||
file(GLOB test_headers [a-z_]*.h)
|
||||
file(GLOB test_sources [a-z_]*.cpp integration/[a-z_]*.cpp node/[a-z_]*.cpp)
|
||||
file(GLOB test_new_api_sources new-api/[a-z]*.cpp)
|
||||
|
||||
27
test/version_test.cpp.in
Normal file
27
test/version_test.cpp.in
Normal file
@ -0,0 +1,27 @@
|
||||
#include "yaml-cpp/version.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace YAML {
|
||||
namespace {
|
||||
TEST(VersionTest, Major)
|
||||
{
|
||||
ASSERT_EQ(${YAML_CPP_VERSION_MAJOR}, YAML_CPP_VERSION_MAJOR);
|
||||
}
|
||||
|
||||
TEST(VersionTest, Minor)
|
||||
{
|
||||
ASSERT_EQ(${YAML_CPP_VERSION_MINOR}, YAML_CPP_VERSION_MINOR);
|
||||
}
|
||||
|
||||
TEST(VersionTest, Path)
|
||||
{
|
||||
ASSERT_EQ(${YAML_CPP_VERSION_PATCH}, YAML_CPP_VERSION_PATCH);
|
||||
}
|
||||
|
||||
TEST(VersionTest, String)
|
||||
{
|
||||
ASSERT_STREQ("${YAML_CPP_VERSION}", YAML_CPP_VERSION);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user