Switched around the header and unit test. Now the unit test is created by CMake using the variables set in there and the version.h header is created manually. Unit test checks that both the CMake variables and header share the same version.
28 lines
458 B
C++
28 lines
458 B
C++
#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);
|
|
}
|
|
}
|
|
}
|