[PATCH 1/2] sapi: Add <rtems/test.h>

Gedare Bloom gedare at rtems.org
Tue Mar 11 12:48:29 UTC 2014


Sebastian,
On Tue, Mar 11, 2014 at 3:33 AM, Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
> On 2014-03-10 20:10, Sebastian Huber wrote:
>>
>> On 03/10/2014 06:55 PM, Joel Sherrill wrote:
>>>
>>> testsuites/support
>>
>>
>> Ok, I would like to avoid the massive copy and paste in the Makefiles.
>>
>
> I would like to move away from the existing test support.  The problem is
> that you have to add at least this in every test Makefile.am:
>
> test_SOURCES += ../../support/src/test_support.c
> AM_CPPFLAGS += -I$(top_srcdir)/../support/include
>
> I consider ../ paths in Makefiles as hacks.
>
> You have to compile test_support.c again for each tests which increases the
> build times.
>
> You have also hacks like this in a header file (buffer_test_io.h):
>
>   #if defined(TEST_INIT) || defined(CONFIGURE_INIT)
>
>     char _test_output_buffer[_TEST_OUTPUT_BUFFER_SIZE];
>     int _test_output_buffer_index = 0;
>
>     void _test_output_append(char *_buffer)
>     {
>       char *p;
>
>       for ( p=_buffer ; *p ; p++ ) {
>         _test_output_buffer[_test_output_buffer_index++] = *p;
>         _test_output_buffer[_test_output_buffer_index]   = '\0';
>         #if 0
>           if ( *p == '\n' ) {
>             fprintf( stderr, "BUFFER -- %s", _test_output_buffer );
>             _test_output_buffer_index = 0;
>            _test_output_buffer[0]   = '\0';
>           }
>         #endif
>         if ( _test_output_buffer_index >= (_TEST_OUTPUT_BUFFER_SIZE - 80) )
>           _test_output_flush();
>       }
>     }
>
>     #include <termios.h>
>     #include <unistd.h>
>
>     void _test_output_flush(void)
>     {
>       fprintf( stderr, "%s", _test_output_buffer );
>       _test_output_buffer_index = 0;
>       tcdrain( 2 );
>     }
>
>     #endif
>
>
> What is the disadvantage of moving this into a general purpose library?
>
I'm on board with an RTEMS testing support library within the cpukit.
Please make a separate discussion describing how it would
work--obviously, this test.h shows most of it, but reading the code
will be less efficient than you describing the design to us. Then we
can make the enlightened decision.
Thanks,
Gedare

>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax     : +49 89 189 47 41-09
> E-Mail  : sebastian.huber at embedded-brains.de
> PGP     : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
> _______________________________________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-devel




More information about the devel mailing list