<div dir="ltr"><div><div><div>Hi Sebastian,<br><br></div>Unfortunately the project was on hold for a while now due to administrative reasons. I am just about get back into it so expect more updates soon.<br><br></div>As to the thread safety of Unity I was not aware that was an explicit requirement for a testing framework. If you are referring to accessing the Unity struct then this is something I could serialize, or even better I will check if somebody has implemented this already.<br>
<br></div><div>Thanks for pointing it out.<br></div><div><br><br></div>Marcin<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 20 November 2013 16:11, Sebastian Huber <span dir="ltr"><<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Marcin,<br>
<br>
I just checked out the Unity sources and had a brief look at it. I see one major problem with this framework. It is not thread-safe, e.g. you have functions like this:<br>
<br>
<a href="https://github.com/ThrowTheSwitch/Unity/blob/master/src/unity.c" target="_blank">https://github.com/<u></u>ThrowTheSwitch/Unity/blob/<u></u>master/src/unity.c</a><br>
<br>
[...]<br>
//----------------------------<u></u>-------------------<br>
void UnityAssertNumbersWithin( const _U_SINT delta,<br>
const _U_SINT expected,<br>
const _U_SINT actual,<br>
const char* msg,<br>
const UNITY_LINE_TYPE lineNumber,<br>
const UNITY_DISPLAY_STYLE_T style)<br>
{<br>
UNITY_SKIP_EXECUTION;<br>
<br>
if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT)<br>
{<br>
if (actual > expected)<br>
Unity.CurrentTestFailed = ((actual - expected) > delta);<br>
else<br>
Unity.CurrentTestFailed = ((expected - actual) > delta);<br>
}<br>
else<br>
{<br>
if ((_U_UINT)actual > (_U_UINT)expected)<br>
Unity.CurrentTestFailed = ((_U_UINT)(actual - expected) > (_U_UINT)delta);<br>
else<br>
Unity.CurrentTestFailed = ((_U_UINT)(expected - actual) > (_U_UINT)delta);<br>
}<br>
<br>
if (Unity.CurrentTestFailed)<br>
{<br>
UnityTestResultsFailBegin(<u></u>lineNumber);<br>
UnityPrint(UnityStrDelta);<br>
UnityPrintNumberByStyle(delta, style);<br>
UnityPrint(UnityStrExpected);<br>
UnityPrintNumberByStyle(<u></u>expected, style);<br>
UnityPrint(UnityStrWas);<br>
UnityPrintNumberByStyle(<u></u>actual, style);<br>
UnityAddMsgIfSpecified(msg);<br>
UNITY_FAIL_AND_BAIL;<br>
}<br>
}<br>
[...]<br>
<br>
So now if multiple threads call this function the result is unpredictable.<br>
<br>
Thread-safety is a mandatory feature for a unit test framework for RTEMS from my point of view, so either we add this to Unity or search for something else.<div class="HOEnZb"><div class="h5"><br>
<br>
-- <br>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone : +49 89 189 47 41-16<br>
Fax : +49 89 189 47 41-09<br>
E-Mail : <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-<u></u>brains.de</a><br>
PGP : Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
</div></div></blockquote></div><br></div>