Skip to content

manlioGit/gtest-cpp-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gtest-cpp-template

project template to quick start with cmake, gtest and modules

Project Structure

gtest-cpp-template
+--main
|  +--moduleA
|     +--A.h.cpp
|  +--main.cpp
|  +--MainLevel.h/cpp
|
+--test
|  +--moduleA
|     +--ATest.cpp
|  +--MainLevelTest.cpp

Examples

MainLevelTest

#include "gtest/gtest.h"
#include "MainLevel.h"

class MainLevelTest : public ::testing::Test {
protected:
  void SetUp() override {
  }

  void TearDown() override {
  }
};

TEST_F(MainLevelTest, value){
  MainLevel m("m");

  ASSERT_EQ("m", m.Value());
}

moduleA/ATest

#include <gtest/gtest.h>
#include "A.h"

class ATest : public ::testing::Test {

protected:
  void SetUp() override {
  }

  void TearDown() override {

  }
};

TEST_F(ATest, value){
  A a("a");

  ASSERT_EQ("a", a.Value());
}

About

project template to quick start with cmake, gtest and modules

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors