[erlang-patches] patch: common_test include vs. include_lib

Peter Andersson <>
Thu Jan 14 15:46:04 CET 2010


Hi Fred,

Thanks for the fix!

Problem is that for this to work (to use include_lib instead of include
in ct.hrl), test_server and common_test must be included in the
bootstrap compiler, or we fail to build common_test for our nightly
tests. That said, I agree it's a lot nicer to use include_lib so that
test suites can be manually compiled with the hassle of specifying
include paths to test_server and common_test. Therefore we've decided to
modify the bootstrap compiler and include your fix as soon as possible.

Actually, we have looked into changing this before. But since test suite
compilation is performed automatically by common_test, and because of
the problem mentioned above, we never prioritized it. But like I said,
we do realize the benefit of being able to compile test suites manually
without invoking common_test, and since you take the time now to send us
this patch, we'll finally do something about it.

Best regards,
Peter

Erlang/OTP, Ericsson AB

Fred Hebert wrote:
> I've changed the 'ct.hrl' include file to call 'include_lib' on
> 'test_server.hrl' rather than a straight include.
> I've also updated the example code in the documentation to use 'include_lib'
> rather than a straight 'include' for 'ct.hrl' in order to be constant.
>
> The current standard include is annoying because during compilation you get
> errors about files not being found. The only workarounds I found on the web
> were to define your own ct.hrl file or to give the include paths to the
> compiler. As far as I know, this is because common_test hasn't always been
> distributed with the OTP libs and it looks like it stayed the same after
> being included (correct me if I'm wrong). This fix should make it work like
> any other library include without breaking old code, given the workarounds
> should still work now.
>
> branch: http://github.com/ferd/otp/tree/common_test_includes
>
> git fetch git://github.com/ferd/otp.git common_test_includes
>
>   



More information about the erlang-patches mailing list