<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p></p>
<div>Hi everyone</div>
<div><br>
</div>
<div>I'm hitting up against against how Erlang passes compile options to parse_transform and was wanting some guidance.</div>
<div><br>
</div>
<div>I'm making changes to lager's parse_tranform and I'm making eunit tests to check these changes. The changes involve setting compile options to add extra metadata to logging calls, such as the example below.</div>
<div><br>
{erl_opts, [</div>
<div>  {parse_transform, lager_transform},</div>
<div>  {lager_function_transforms, [</div>
<div>    {metadata_value, {module_name, function_name}}</div>
<div>  ]}</div>
<div>]}.<br>
<br>
</div>
<div>One of these tests involves calls to a undefined Module:Function and I need to apply the transform only to the specific test file since this will break all the other tests.</div>
<div><br>
If I set lager_function_transforms in lager's rebar.config eunit_compile_opts it applies the transforms to all  the tests with -compile([{parse_transform, lager_transform}]). If I supply these options to the -compile, they don't appear in the options provided
 to the parse_transform.</div>
<div><br>
-compile([</div>
<div>  {parse_transform, lager_transform}, % If you don't supply this to the test file it won't transformed</div>
<div>  {lager_function_transforms, [ % But these options seem to be ignored</div>
<div>    {metadata_value, {module_name, function_name}}</div>
<div>  ]}</div>
<div>]).</div>
<div><br>
</div>
<div>Is there a way a to compile these new tests with my specific settings without applying them globally, or having to compile them separately?</div>
<div><br>
</div>
<div>Thank you</div>
<div>Michael</div>
<p></p>
<p></p>
</div>
</body>
</html>