All Projects → FreeYourSoul → FSeam

FreeYourSoul / FSeam

Licence: MIT license
Cpp header only library to manage compile time mock class generated via Python script

Programming Languages

python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language
CMake
9771 projects
Nix
1067 projects

Projects that are alternatives of or similar to FSeam

ogen
OpenAPI v3 code generator for go
Stars: ✭ 436 (+419.05%)
Mutual labels:  code-generator
kube-code-generator
Kubernetes code generator docker image
Stars: ✭ 60 (-28.57%)
Mutual labels:  code-generator
typed-astunparse
Python 3 AST unparser with type comments support.
Stars: ✭ 27 (-67.86%)
Mutual labels:  code-generator
cygnite-application
Cygnite PHP Framework- Skeleton Application
Stars: ✭ 26 (-69.05%)
Mutual labels:  code-generator
kgql
GraphQL Document wrapper generator for Kotlin Multiplatform Project and Android
Stars: ✭ 54 (-35.71%)
Mutual labels:  code-generator
EasyEE-Auto
EasyEE 自动化代码生成器。EasyEE Automated code generator.
Stars: ✭ 39 (-53.57%)
Mutual labels:  code-generator
puml2code
PlantUML code generator
Stars: ✭ 66 (-21.43%)
Mutual labels:  code-generator
sqlw-mysql
Wrapper code (or any text source) generator for MySQL databases and queries
Stars: ✭ 45 (-46.43%)
Mutual labels:  code-generator
sympiler
Sympiler is a Code Generator for Transforming Sparse Matrix Codes
Stars: ✭ 32 (-61.9%)
Mutual labels:  code-generator
barectf
Generator of ANSI C tracers which output CTF data streams
Stars: ✭ 50 (-40.48%)
Mutual labels:  code-generator
uml2solidity
A uml profile and a set of acceleo code generators to model smart contracts in uml and generate solidity code.
Stars: ✭ 35 (-58.33%)
Mutual labels:  code-generator
CGbR
The CGbR project combines the flexibility of reflection with the speed of native code.
Stars: ✭ 15 (-82.14%)
Mutual labels:  code-generator
objectbox-generator
ObjectBox Generator based on FlatBuffers schema files (fbs) for C and C++ (more languages in the future)
Stars: ✭ 30 (-64.29%)
Mutual labels:  code-generator
django-code-generator
Generate code from your Django models for faster development
Stars: ✭ 35 (-58.33%)
Mutual labels:  code-generator
gogen
Clean Architecture Code Generator
Stars: ✭ 42 (-50%)
Mutual labels:  code-generator
libcester
A robust header-only unit testing framework for C and C++ programming language. Support function mocking, memory leak detection, crash report.
Stars: ✭ 50 (-40.48%)
Mutual labels:  mocking-framework
IOS-CoreBluetooth-Mock
Mocking library for CoreBluetooth framework.
Stars: ✭ 142 (+69.05%)
Mutual labels:  mocking-framework
markyp-bootstrap4
Create Bootstrap 4 web pages using purely Python.
Stars: ✭ 19 (-77.38%)
Mutual labels:  code-generator
mr.boilerplate
Online app to generate Scala boilerplate
Stars: ✭ 32 (-61.9%)
Mutual labels:  code-generator
tiles
Programmatic code generation
Stars: ✭ 78 (-7.14%)
Mutual labels:  code-generator

GitHub license

FSeam

FSeam logo

Python script to generate cpp mock for FSeam

Python and CMake (version minimum 3.10.0) are required to use FSeam

What is a Link Seam mock?

A seam is a term introduced by Michael Feathers in his book Working effectively with legacy code. It basically describe a way to change the behavior of a function/functionality, which is very usefull for testing while ignoring external dependencies.

A lot of different seams exist and are described in this accu article that is a must read.
When talking about seam, for FSeam, it is assumed we are talking about link seam.

The goal of such seam is to change the behavior of a class by tweaking the ordering, number of the files compiled. FSeam is a combination of a code generator (creating a mocking implementation of the given C++ class/functions) and a header only library that makes you able to change the behaviors of those mock at runtime. And a CMake helper in order to easily implements the generation of code and linking time tricks.
Why do we need yet another mocking framework?

In Resume, what is FSeam?

FSeam is a python script that will generate cpp files that contains fake implementation of class/functions (those will not call the original implementation), this is a what we will call a seam mocked implementation. This implementation is going to replace the actual implementation at Linking time (thanks to CMake helpers functions) and is going to register information about how the functions has been called (arguments, number of time etc...). And thanks to the header only FSeam library, you will be able to manipulate those mocks (changing behavior, verify usage).

Advantage of FSeam

  • Mocking without impacting production code
  • Mocking default behavior (no need to access a particular instance of the mocked object to manipulate its behavior)
  • Mocking of static / free functions as easily as any classes
  • Easy to setup (all of those thing are installed and ready to use when following the installation step below):
    • Header only library to include in test file
    • A Python script
    • CMake file to include in order to easily do the compile tweaking and code generation

How to install

  git clone https://github.com/FreeYourSoul/FSeam.git  
  cd FSeam  
  mkdir build  
  cd build  
  cmake ..  
  make && make test && sudo make install

In case of dependencies issue : follow this link

Documentation

Ambition

This project is extensively used to test FyS, it is a Proof of Concept. The idea in itself is worth exploring and improving, and I intend to do that through this project. If this project can be of any interest for your personal and/or professional projects, any help to make it more stable and usable is welcomed.

Dependencies

Using extensively CppHeaderParser, originally developed by Jashua Cloutier(original repo)
The project is currently handled by robotpy (current repo)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].