With current setup to write a test for a component the component has to have its API exported. This is not a valid approach. The solution I can think of at the moment is to move test source files into the project source tree so that they are linked directly with the component they verify. They should be put preferable in the same directory with the test files names identical to the component but with some suffix, let say _test.