From e67a5dda6117ee83dfcb73deaad5c06d62fa8e59 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Tue, 10 Dec 2019 09:19:00 +0000 Subject: [PATCH] Add implementation --- CMakeLists.txt | 2 +- iproject.h | 9 +++++++++ project.cc | 7 +++++-- project.h | 10 +++++++++- test/main_test.cc | 3 +++ test/project_test.cc | 19 +++++++++++++++++++ 6 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 iproject.h create mode 100644 test/main_test.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index fa050f2..e6318a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.5.1) project(dummy_cmake_project) set(CMAKE_CXX_STANDARD 14) diff --git a/iproject.h b/iproject.h new file mode 100644 index 0000000..ec4452f --- /dev/null +++ b/iproject.h @@ -0,0 +1,9 @@ +#pragma once + +namespace dev{ + +class IProject { + virtual int run() = 0; +}; + +} diff --git a/project.cc b/project.cc index eb32d55..fdc1225 100644 --- a/project.cc +++ b/project.cc @@ -1,5 +1,8 @@ #include "project.h" -int sum(int x, int y) { - return x + y; +namespace dev { + +int Project::run() { + return 0; } +} // namespace dev diff --git a/project.h b/project.h index f024477..b5cc813 100644 --- a/project.h +++ b/project.h @@ -1,3 +1,11 @@ #pragma once +#include "iproject.h" -int sum(); +namespace dev { + +class Project : public IProject { + // IProject interface + public: + int run(); +}; +} // namespace dev diff --git a/test/main_test.cc b/test/main_test.cc new file mode 100644 index 0000000..c792e8f --- /dev/null +++ b/test/main_test.cc @@ -0,0 +1,3 @@ +#include "project.h" +#include +#include diff --git a/test/project_test.cc b/test/project_test.cc index e69de29..5dbeb2f 100644 --- a/test/project_test.cc +++ b/test/project_test.cc @@ -0,0 +1,19 @@ +#include "project.h" +#include +#include +namespace dev { +namespace testing { + +class ProjectTest : public ::testing::Test { + public: + void SetUp() override {} + void TearDown() override {} + dev::Project project_; +}; + +TEST_F(ProjectTest, Run) { + ASSERT_EQ(0, project_.run()); +} + +} // namespace testing +} // namespace dev