(CMake) Add a new CMake option to enable the new Unit Tests
parent
89629f0056
commit
26189ad287
@ -0,0 +1,9 @@
|
||||
add_executable(unit_tests mainTestRunner.cpp
|
||||
test_types.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(unit_tests
|
||||
PRIVATE
|
||||
exiv2lib
|
||||
GTest::GTest
|
||||
)
|
@ -0,0 +1,14 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
|
||||
int ret = RUN_ALL_TESTS();
|
||||
|
||||
std::cout << "Tests finished with return value: " << ret << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <exiv2/types.hpp>
|
||||
|
||||
using namespace Exiv2;
|
||||
|
||||
TEST(ExivTime, getsTimeFromValidString)
|
||||
{
|
||||
struct tm tmInstance;
|
||||
ASSERT_EQ(0, exifTime("2007:05:24 12:31:55", &tmInstance));
|
||||
/// \todo add more checks here
|
||||
}
|
Loading…
Reference in New Issue