Giter VIP home page Giter VIP logo

mockcpp's Introduction

	mockcpp --- A C/C++ Mock Framework
	-------------------------------------
	https://github.com/sinojelly/mockcpp
	https://gitee.com/sinojelly/mockcpp

mockcpp is a jmock-like generic C/C++ Mock Framework, which doesn't use complex template technique which will result in very heavy compiling overhead.

C/C++ test framework

This project provided two tools for C/C++ testing.

Name Description Path
mockcpp C/C++ mock framework mockcpp
testngpp C/C++ test framework mockcpp/tests/3rdparty/testngpp

The sample project to use these tools is at :
https://gitee.com/sinojelly/testngpp-mockcpp-sample

You can use mockcpp with other C/C++ test framework, such as gtest, Catch2, CppUTest etc. The sample projects are at:
https://gitee.com/sinojelly/gtest-with-mockcpp
https://gitee.com/sinojelly/catch2-with-mockcpp

You can use mockcpp testngpp prebuilt libraries and header files, or use their source code.

If you use the prebuilt libraries, be sure they are built on the same os and compiler as the project that is being tested.

mockcpp features

OS Compiler Virtual method mock Global function mock Overloaded function mock Non-virtual method mock (Experiment)
Linux GCC Yes Yes Yes Yes
Win10 MinGW Yes Yes Yes Yes
Win10 VS2019 Yes No Yes Not test

testngpp features

OS Compiler Base function Memory leak check Run in Sandbox Parameterized test
Linux GCC Yes Yes Yes Yes
Win10 MinGW Yes No No Yes
Win10 VS2019 Yes Yes Yes Yes

Sample code

Testngpp parameterized test sample

FIXTURE(DataDrivenTest)
{
	DATA_PROVIDER( mydata, 3
		, DATA_GROUP(1, 2, 3) 
		, DATA_GROUP(77, 20, 97) 
		, DATA_GROUP(101, 503, 604));

	// @test(data="mydata")
	PTEST( (int a, int b, int c), this is a parameterized test)
	{
		ASSERT_EQ(c, add(a, b));
	}
};

Documents for user

New Build System Description(recommended for user and developers)
Mockcpp manual english
Mockcpp manual chinese
Mockcpp simple instruction (Chinese, recommended)
Testngpp simple instruction (Chinese, recommended)
Testngpp user manual (Chinese)

Documents for developer

Advanced Guide of Mockcpp
Mockcpp version history
Software Architecture (Chinese)
Mockcpp configure parameter
Mockcpp Build Guide (a bit old)
Mockcpp Install Guide (old)

Other documents for reference

Testngpp MSVC Installation (old)
Testngpp Introduction

Email to the current maintainers may be sent to [email protected], [email protected].

mockcpp's People

Contributors

fish2bird avatar googlecodeexporter avatar sinojelly avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.