Reviving this thread, in case anyone is still interested:
I have implemented a simple emulator like this, along with a number of 'fake' devices (TFT displays, real-time clock modules, temperature sensors), and I have been using it quite successfully to test my sketches.
https://github.com/dejwk/roo_testing
Caveat: it only works with Arduino, although porting it to the ESP-IDF shouldn't be prohibitively hard, since most of the instrumentation is in low-level code (interacting with hardware registers or HAL).
It doesn't really emulate all the hardware; it just runs the code on Linux, much like kolban had originally requested. But it has a decent C++ interface to emulate external devices. In particular, it emulates SPI at the physical register level, and reflects bus performance rather accurately.
If anyone is interested, feel free to use, or drop a feature request. I will also more than welcome external contributions.