From this article Unit testing with mock objects in C:
This is done by using the
--wrap
linker option which takes the name of the wrapped function as an argument. If the test was compiled using gcc, the invocation might look like:
$ gcc -g -Wl,--wrap=chef_cook waiter_test.c chef.c
How can I do this when compiling a C project in visual studio?
来源:https://stackoverflow.com/questions/33790425/visual-studio-c-linker-wrap-option