Skip to content
Generate exploding fakes from c/c++ linker error output (used for unit testing)
Shell C++ C
Branch: master
Clone or download

README.md

gen-xfakes

Generate exploding fakes from c/c++ linker error output (used for unit testing)

Usage

Capture the linker error output and feed it to the gen-xfakes.sh


$ make 2>error-output.txt
$ path/to/gen-xfakes.sh error-output.txt xfakes

gen-xfakes.sh produces three files with the supplied basename xfakes

xfakes-c.c C linkage fakes, ready to add to your build
xfakes-cpp.cpp C++ linkage fakes, edits needed
xfakes-cpp-globals.cpp C++ undefined globals, edits needed

Supported formats

  • g++ linker output
  • clang
  • Visual Studio -- best guess

To be supported formats

Examples

See test/example-gcc-link-errors.txt for example input. The output files are found in test/golden.

A full explanation of how to use gen-xfakes is on my blog here.

You can’t perform that action at this time.