Questions tagged [cpputest]

CppUTest is a C/C++ based unit xUnit test framework for unit testing and test-driving code.

CppUTest is a C /C++ based unit xUnit test framework for unit testing and for test-driving your code. It is written in C++ but is used in C and C++ projects and frequently used in embedded systems but it works for any C/C++ project.

CppUTest’s core design principles are:

  • Simple in design and simple in use.
  • Portable to old and new platforms.
  • Build with Test-driven Development in mind

CppUTest has support for building mocks. This document described the mocking support. A couple of design goals for the mocking support were:

  • Same design goals as CppuTest – limited C++ set to make it well suitable for embedded soft.
  • No code generation
  • No or very few magic hiding macros
  • Very simple to use
  • The developer stays in control

The main idea is to make manual mocking easier, rather than to make automated mocks. If manual mocking is easier, then it could also be automated in the future, but that isn’t a goal by itself.

Official Website: http://cpputest.github.io/

Useful Links:

98 questions
0
votes
0 answers

Arguments in C error

I am unit testing a function which has arguments like; extern int32_t fabl_fmtstr_fprint (FILE *op UNUSED, const char *format, ...){} I am not sure what the argument "..." is for. I am getting compile time error for it. error: declaration of C…
Shandeep Murugasamy
  • 311
  • 2
  • 3
  • 15
0
votes
1 answer

Why "unresolved external symbol" in VS2010 (lnk2001) when symbol is defined in .lib? C++, boost, cpputest

I'm getting this error from the linker: 1>PACBalancesTest.obj : error LNK2001: unresolved external symbol "public: bool __thiscall PAC::BalChgKeyComparator::operator()(class PAC::BalChgKey const &,class PAC::BalChgKey const &)const "…
0
votes
1 answer

In which file is the version number of CppUTest defined

In which source/include file is the version number of CppUTest (http://cpputest.github.io) defined ? I have search all files, both .cpp and .h files but could not find anything. The latest version, according to CppUtest homepage is 3.4 and I want to…
Stefan Olsson
  • 23
  • 2
  • 6
0
votes
1 answer

Eclipse+CDT: Build and Link Tested Project's files in Test Project

Trying to set up an embedded TDD environment in Eclipse: Application Project set up for GNU-ARM cross-compilation CppUTest Project to build CppUTest via Cygwin (working great) Test Project to house unit tests, test groups, test runner Trouble I'm…
mtbkrdave
  • 2,900
  • 3
  • 23
  • 24
0
votes
1 answer

Linker errors when attempting to use TEST_GROUP_BASE shared test group when testing legacy C code

We have attempted to reduce code duplication through the use of the TEST_GROUP_BASE to create a shared base class. When we attempt to use this TEST_GROUP_BASE in more than one test class, we get linker warnings complaining about 'getwchar'and…
PeeGee
  • 99
  • 8
-1
votes
1 answer

CppUTest on Jenkins

We use CppUTest to run unit tests. This is being performed by Cmake/Ninja where after building the tests, we use ninja to execute them ninja test an example output of this is: 1/3 Test #1: Test1................................................... …
user654789384
  • 305
  • 1
  • 4
  • 21
-1
votes
2 answers

How to test the sequence of function calls in C?

I'm using Gtest to perform unit testing to a C module. One of the requirements is to verify that a function called Supervision_Log() is called after executing several different functions. The C file includes the following: void MainFunction…
Mohamed Ameen
  • 65
  • 1
  • 8
-1
votes
1 answer

Is any way to mock global variable in CppUTest?

Is there any way to mock static global variable to use in test function? Or any workaround for that? Below example of such situation: static zsock_t *publish_logs = NULL; int btak_log_message_reactor(zloop_t *loop, zsock_t *reader, void *arg) { …
PaulWebbster
  • 1,480
  • 2
  • 14
  • 27
1 2 3 4 5 6
7