fschmidt wrote
What I want is that if module X depends on module Y, then module X should contain some code, not to test itself, but rather to test that the functions that needs from module Y are available and work as expected.
I am not sure I understand this. Do you mean that each module should contain some test code to check if the needed modules are working as expected? In general, unit tests are kept separate from the main code, but I guess you could keep things together as local functions (so that no one can call them except the module itself). Is this what you have in mind?
Actually I am a little bit confused about this. For example, look at the String module. You could have unit tests specific for that module (no other dependencies need to be checked). If two modules depend on the String module, they don't have to test the String module again, right?