aboutsummaryrefslogtreecommitdiff
path: root/tools/interface_generator/bin/templates/interface_mock.hpp.mako
blob: e33d50eb176d6cad8fa40a5675173bc64c5b7d68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<%include file="__header.mako" />
#ifndef ${ name.upper() }_MOCK
#define ${ name.upper() }_MOCK

extern "C" {
#include "${ name }.h"
}

#include <gtest/gtest.h>
#include <gmock/gmock.h>

class I${name}_mock
{
public:
  I${name}_mock();
  ~I${name}_mock();

  /* Functions */
% for fn in functions:
  MOCK_METHOD(${fn['return']}, ${fn['name']}, (${ ", ".join(fn['arguments']) }));
% endfor
};

using ${name}_mock = ::testing::NiceMock<I${name}_mock>;

#endif /* ${ name.upper() }_MOCK */