<p>This is not really about precise naming. During my first time writing unit  test, I copy pasted the template and changed all the <code><module></code> and <code><header></code> accordingly. That includes <code>set_up</code> and <code>tear_down</code> in EMB_UNIT_TESTCALLER call:</p>
<pre><code>static void set_up(void)
{
    /* omit if not needed */
}

static void tear_down(void)
{
    /* omit if not needed */
}

...

Test *tests_<module>_<header>_tests(void)
{
    .....

    EMB_UNIT_TESTCALLER(<module>_<header>_tests,
                        tests_<module>_<header>_set_up,                <----------- Both of these lines
                        tests_<module>_<header>_tear_down, fixtures);  <-----------
    /* set up and tear down function can be NULL if omitted */

    return (Test *)&<module>_<header>;
}
</code></pre>
<p>The test failed to build because there is no <code>tests_<module>_<header>_set_up</code> and <code> tests_<module>_<header>_tear_down</code>. There is only <code>set_up</code> and <code>tear_down</code>. After spending a few minutes on it I managed to figure it out and make the changes accordingly.</p>
<p>Because of that I thought maybe it will be easier for newcomers to write their first test in the future with these changes :)</p>
<p>Based on the comments, would it be better if the <code>set_up</code> and <code>tear_down</code> in EMB_UNIT_TESTCALLER are changed instead?</p>
<p>So the changes would be:</p>
<pre><code>Test *tests_<module>_<header>_tests(void)
{
   ...

    EMB_UNIT_TESTCALLER(<module>_<header>_tests,
                        set_up, tear_down, fixtures);
    /* set up and tear down function can be NULL if omitted */

    return (Test *)&<module>_<header>;
}
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11863?email_source=notifications&email_token=ABE7WYCU2NOK23A7FEHAK4TQAGAARA5CNFSM4IEZY6L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2LCBDI#issuecomment-513155213">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYE3YXWQP7B4XAOONEDQAGAARANCNFSM4IEZY6LQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYBY3AQMNYT4HY6B3TTQAGAARA5CNFSM4IEZY6L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2LCBDI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11863?email_source=notifications\u0026email_token=ABE7WYCU2NOK23A7FEHAK4TQAGAARA5CNFSM4IEZY6L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2LCBDI#issuecomment-513155213",
"url": "https://github.com/RIOT-OS/RIOT/pull/11863?email_source=notifications\u0026email_token=ABE7WYCU2NOK23A7FEHAK4TQAGAARA5CNFSM4IEZY6L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2LCBDI#issuecomment-513155213",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>