Author Topic: support for gtest (google test)  (Read 2070 times)

shadm

  • Community Member
  • Posts: 49
  • Hero Points: 0
support for gtest (google test)
« on: October 24, 2013, 03:15:15 PM »
I'd like to see support for gtest (google test) and/or other unit test frameworks for C/C++.  I suspect there may be others that would like to see it for their language as well.  If there is anything out there that provides this ability for Slickedit, I'd certainly be willing to give it a go.

proengin

  • New Community Member
  • Posts: 1
  • Hero Points: 1
Re: support for gtest (google test)
« Reply #1 on: January 29, 2014, 03:00:23 PM »
I'd like to see support for gtest (google test).

Phil Barila

  • Senior Community Member
  • Posts: 745
  • Hero Points: 61
Re: support for gtest (google test)
« Reply #2 on: January 16, 2015, 07:35:33 PM »
I'd like to add a request for gtest.  There was a request about a year ago.  The issue arises in that you define tests by declaring them with a macro invocation, which seems to completely flummox SE.
Defining the test class is simple enough, and SE does fine:

Code: [Select]
#include "gtest/gtest.h"
#include "MockLogger.h"

class ClassTest : public ::testing::Test
{
    protected:
        MockLogger _logger;
};
And then ...
Code: [Select]
#include "ClassTest.h"
#include "Class.h"

TEST_F(ClassTest, testConstructor)
{
    Class c(_logger);

    ASSERT_EQ(0, c.getProperty());
}
No matter how many of the gtest macro definitions I import into C/C++ Preprocessing, it won't identify _logger as a member, because it doesn't recognize "testConstructor" that it's actually defining a method in ClassTest.