cpputest/4.0

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.
Recipe info
2022-10-24

Available packages
Linux
Windows
macOS
macOS Apple Silicon

Install
Add the following line to your conanfile.txt:
[requires]
cpputest/4.0

Using cpputest

Note

If you are a new Conan user, we recommend reading the how to consume packages tutorial.

If you need additional assistance, please ask a question in the Conan Center Index repository.

Simplest use case consuming this recipe and assuming CMake as your local build tool:

[requires]
cpputest/4.0
[generators]
CMakeDeps
CMakeToolchain
[layout]
cmake_layout
from conan import ConanFile
from conan.tools.cmake import cmake_layout


class ExampleRecipe(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeDeps", "CMakeToolchain"

    def requirements(self):
        self.requires("cpputest/4.0")

    def layout(self):
        cmake_layout(self)

Now, you can run this Conan command to locally install (and build if necessary) this recipe and its dependencies (if any):

$ conan install conanfile.txt --build=missing

Useful information to take into account to consume this library:


These are the main declared targets:

  • CMake package name(s): CppUTest
  • CMake target name(s): cpputest::cpputest
  • CppUTest => CppUTest
    CppUTestExt => CppUTestExt
    
  • pkg-config file name(s): cpputest.pc
  • CppUTest => cpputest-CppUTest.pc
    CppUTestExt => cpputest-CppUTestExt.pc
    

A simple use case using the CMake file name and the global target:

# ...
find_package(CppUTest REQUIRED)
# ...
target_link_libraries(YOUR_TARGET cpputest::cpputest)

These are all the available headers. Some of these ones might be non-public; make sure of it by visiting the cpputest homepage listed above:

#include "CppUTest/CommandLineArguments.h"
#include "CppUTest/CommandLineTestRunner.h"
#include "CppUTest/CppUTestConfig.h"
#include "CppUTest/CppUTestGeneratedConfig.h"
#include "CppUTest/JUnitTestOutput.h"
#include "CppUTest/MemoryLeakDetector.h"
#include "CppUTest/MemoryLeakDetectorMallocMacros.h"
#include "CppUTest/MemoryLeakDetectorNewMacros.h"
#include "CppUTest/MemoryLeakWarningPlugin.h"
#include "CppUTest/PlatformSpecificFunctions.h"
#include "CppUTest/PlatformSpecificFunctions_c.h"
#include "CppUTest/SimpleMutex.h"
#include "CppUTest/SimpleString.h"
#include "CppUTest/SimpleStringInternalCache.h"
#include "CppUTest/StandardCLibrary.h"
#include "CppUTest/TeamCityTestOutput.h"
#include "CppUTest/TestFailure.h"
#include "CppUTest/TestFilter.h"
#include "CppUTest/TestHarness.h"
#include "CppUTest/TestHarness_c.h"
#include "CppUTest/TestMemoryAllocator.h"
#include "CppUTest/TestOutput.h"
#include "CppUTest/TestPlugin.h"
#include "CppUTest/TestRegistry.h"
#include "CppUTest/TestResult.h"
#include "CppUTest/TestTestingFixture.h"
#include "CppUTest/Utest.h"
#include "CppUTest/UtestMacros.h"
#include "CppUTestExt/CodeMemoryReportFormatter.h"
#include "CppUTestExt/GMock.h"
#include "CppUTestExt/GTest.h"
#include "CppUTestExt/GTestConvertor.h"
#include "CppUTestExt/GTestSupport.h"
#include "CppUTestExt/IEEE754ExceptionsPlugin.h"
#include "CppUTestExt/MemoryReportAllocator.h"
#include "CppUTestExt/MemoryReportFormatter.h"
#include "CppUTestExt/MemoryReporterPlugin.h"
#include "CppUTestExt/MockActualCall.h"
#include "CppUTestExt/MockCheckedActualCall.h"
#include "CppUTestExt/MockCheckedExpectedCall.h"
#include "CppUTestExt/MockExpectedCall.h"
#include "CppUTestExt/MockExpectedCallsList.h"
#include "CppUTestExt/MockFailure.h"
#include "CppUTestExt/MockNamedValue.h"
#include "CppUTestExt/MockSupport.h"
#include "CppUTestExt/MockSupportPlugin.h"
#include "CppUTestExt/MockSupport_c.h"
#include "CppUTestExt/OrderedTest.h"