|
|
|
|
|
by dirkf
1561 days ago
|
|
In the C world I sometimes do something similar: the C file with the test code simply #include's the actual source file and gets compiled into one executable (together with some mocks). Not too dirty (ahem...) and allows you to test various internal parts.
And I must admit I got the idea after looking into Rust :) |
|
All the tests end up in the "release" binary, along with the application code. Separate test_main entry point to run the tests instead of the application. If I don't want the tests available, marking test_main static and deadstripping rips them all out.