diff --git a/compiler/vconone/src/version.test.cpp b/compiler/vconone/src/version.test.cpp index 35a0647c135..e76a779b163 100644 --- a/compiler/vconone/src/version.test.cpp +++ b/compiler/vconone/src/version.test.cpp @@ -18,6 +18,22 @@ #include +#include + +namespace { + +int get_current_year(void) +{ + auto now = std::chrono::system_clock::now(); + std::time_t current_time = std::chrono::system_clock::to_time_t(now); + std::tm* timeinfo = std::localtime(¤t_time); + + int year = timeinfo->tm_year + 1900; + return year; +} + +} + TEST(vconone, version_number) { auto v = vconone::get_number(); @@ -45,5 +61,14 @@ TEST(vconone, copyright) { auto str = vconone::get_copyright(); + int year = 2024; + + if (year < get_current_year()){ + std::cout << "!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!\r\n"; + std::cout << "\tPlease update vconone year.\r\n"; + std::cout << "\tIt seems it's a new year and vconcone is not updated.\r\n"; + std::cout << "\tHappy new year!\r\n"; + } + ASSERT_NE("", str); }