[erlang-questions] Rebar, common_test and cover issue

Maxim Treskin <>
Wed Mar 14 10:33:07 CET 2012


Yes, I use latest version of meck from github

On 14 March 2012 14:31, Lukas Larsson <> wrote:

> Hi, meck should retain the cover info if used properly. Also make sure you
> have the latest version. I think some work has been done with cover
> recently.
>
> Lukas
> On Mar 14, 2012 7:25 AM, "Maxim Treskin" <> wrote:
>
>> Thank you for reply, it is really root of the problem.
>> I forgot mention about library meck which loads module and redefines some
>> of its functions. When I remove meck, coverage works as expected. I should
>> think how to replace meck.
>>
>> On 13 March 2012 19:58, Siri Hansen <> wrote:
>>
>>> This is not related to the name of the SUITEs. What happens is that the
>>> modules (my_module1 and my_module2 - and possible other modules as derived
>>> from your cover spec file) are cover compiled and loaded by common_test
>>> before the test starts. The result of the cover compilation exists only in
>>> memory so if the test code explicitly loads these modules again the
>>> original beam files will be used and the cover compiled version disappears.
>>> The only way to overcome this is to avoid loading of code in your tests.
>>> /siri
>>>
>>> Den 10:55 13. mars 2012 skrev Maxim Treskin <>følgende:
>>>
>>>  Yes, this modules loaded in tests. How I can fix this? Rename SUIT
>>>> modules?
>>>>
>>>>
>>>> On 13 March 2012 16:38, Siri Hansen <> wrote:
>>>>
>>>>> This would typically happen if your test loads my_module1 and
>>>>> my_module2. Could that be the case?
>>>>> /siri
>>>>>
>>>>> Den 10:30 13. mars 2012 skrev Maxim Treskin <>følgende:
>>>>>
>>>>>> Hello
>>>>>>
>>>>>> I have strange behaviour of rebar+common_test+cover.
>>>>>> There is two files in ./test/:
>>>>>>
>>>>>> my_module1_SUITE.erl
>>>>>> my_module2_SUITE.erl
>>>>>>
>>>>>> where ct suites defined. When I run `rebar ct verbose=1` I see:
>>>>>>
>>>>>> ```
>>>>>> ...
>>>>>> Cover compiling 'myapp' (16 files) - this may take some time... done
>>>>>> ...
>>>>>> Cover analysing...
>>>>>> WARNING: Analysis failed for my_module1. Reason:
>>>>>> {error,{not_cover_compiled,my_module1}}
>>>>>> WARNING: Analysis failed for my_module2. Reason:
>>>>>> {error,{not_cover_compiled,my_module2}}
>>>>>> ```
>>>>>>
>>>>>> Why I see no any error before at cover compilation step?
>>>>>>
>>>>>> Moreover, if I just replace my_module1_SUITE:all/0 to return just
>>>>>> empty list [], warning "Analysis failed for my_module1" disappears, and
>>>>>> cover for this file appears in cover.html log.
>>>>>>
>>>>>> Can you explain me this strange issues? Is this any bug or expected
>>>>>> behaviour?
>>>>>>
>>>>>> Thank you.
>>>>>>
>>>>>> --
>>>>>> Maxim Treskin
>>>>>> http://metachord.com
>>>>>>
>>>>>> _______________________________________________
>>>>>> erlang-questions mailing list
>>>>>> 
>>>>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Maxim Treskin
>>>>
>>>
>>>
>>
>>
>> --
>> Maxim Treskin
>>
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>


-- 
Maxim Treskin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120314/85ca3f7e/attachment.html>


More information about the erlang-questions mailing list