Re: SMP build fails looking for omp.h

2018-10-19 Thread Joel Sherrill
On Fri, Oct 19, 2018, 1:34 AM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> - Am 18. Okt 2018 um 20:02 schrieb joel j...@rtems.org:
>
> > Hi
> >
> > Looks like there is a missing configuration check for omp.h:
> >
> >
> >
> ../../../../../../rtems/c/src/../../testsuites/smptests/smpopenmp01/init.c:34:10:
> > fatal error: omp.h: No such file or directory
> >   34 | #include 
> >  |  ^~~
> > compilation terminated.
>
> On which target do you get this error? This header file is provided by GCC
> (needs --enable-libgomp).
>

It was arm which was surprising. I was building the zynq qemu bsp.

>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] POSIX inttypes Testsuite

2018-10-19 Thread Joel Sherrill
A few administrative changes.

There needs to be a proper commit log message.

init.c does not have a copyright/license notices.

There is no .doc file giving a description of the test purposes/cases.



On Wed, Sep 26, 2018 at 11:32 AM Aditya Upadhyay 
wrote:

> ---
>  testsuites/psxtests/Makefile.am|  10 ++
>  testsuites/psxtests/configure.ac   |   1 +
>  testsuites/psxtests/psxinttypes01/init.c   | 122
> +
>  .../psxtests/psxinttypes01/psxinttypes01.scn   |  28 +
>  4 files changed, 161 insertions(+)
>  create mode 100644 testsuites/psxtests/psxinttypes01/init.c
>  create mode 100644 testsuites/psxtests/psxinttypes01/psxinttypes01.scn
>
> diff --git a/testsuites/psxtests/Makefile.am
> b/testsuites/psxtests/Makefile.am
> index 2a18d54..c7b4899 100644
> --- a/testsuites/psxtests/Makefile.am
> +++ b/testsuites/psxtests/Makefile.am
> @@ -15,6 +15,16 @@ psx_lib =
>  support_includes = -I$(top_srcdir)/../support/include
>
>  if HAS_POSIX
> +if TEST_psxinttypes01
> +psx_tests += psxinttypes01
> +psx_screens += psxinttypes01/psxinttypes01.scn
> +psxinttypes01_SOURCES = psxinttypes01/init.c
> +psxinttypes01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_psxinttypes01) \
> +   $(support_includes) -I$(top_srcdir)/include
> +endif
> +endif
> +
> +if HAS_POSIX
>  if TEST_psx01
>  psx_tests += psx01
>  psx01_SOURCES = psx01/init.c psx01/task.c psx01/system.h \
> diff --git a/testsuites/psxtests/configure.ac b/testsuites/psxtests/
> configure.ac
> index cdd6ee7..85559e4 100644
> --- a/testsuites/psxtests/configure.ac
> +++ b/testsuites/psxtests/configure.ac
> @@ -91,6 +91,7 @@ RTEMS_TEST_CHECK([psxid01])
>  RTEMS_TEST_CHECK([psximfs01])
>  RTEMS_TEST_CHECK([psximfs02])
>  RTEMS_TEST_CHECK([psxintrcritical01])
> +RTEMS_TEST_CHECK([psxinttypes01])
>  RTEMS_TEST_CHECK([psxitimer])
>  RTEMS_TEST_CHECK([psxkey01])
>  RTEMS_TEST_CHECK([psxkey02])
> diff --git a/testsuites/psxtests/psxinttypes01/init.c
> b/testsuites/psxtests/psxinttypes01/init.c
> new file mode 100644
> index 000..7f5942a
> --- /dev/null
> +++ b/testsuites/psxtests/psxinttypes01/init.c
> @@ -0,0 +1,122 @@
> +#ifdef HAVE_CONFIG_H
> +#include "config.h"
> +#endif
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +const char rtems_test_name[] = "PSXINTTYPE 01";
> +
> +/* forward declarations to avoid warnings */
> +rtems_task Init(rtems_task_argument ignored);
> +
> +rtems_task Init(rtems_task_argument ignored)
> +{
> +  int   base = 10;
> +  char *nptr1= "123abc";
> +  char *endptr1  = NULL;
> +  wchar_t  *nptr2= L"-123junk";
> +  wchar_t  *endptr2  = NULL;
> +  intmax_t  status1;
> +  uintmax_t status2;
> +
> +
> +  TEST_BEGIN();
> +
> +  puts( "\nChecking invalid base value" );
> +  rtems_test_assert( base >=2 && base <= 36 );
> +
> +  /*Test for strtoimax  */
> +  puts( "Strtoimax Testcases" );
> +  puts( "Generating Status" );
> +  status1 = strtoimax( nptr1, &endptr1, base );
> +
> +  rtems_test_assert( status1 != 0);
> +  rtems_test_assert( base != EINVAL);
> +
> +  puts( "Checking Garbage end of endptr" );
> +  rtems_test_assert( *endptr1 != '\0' );
> +
> +  puts( "Checking Underflow Case" );
> +  rtems_test_assert( status1 >= INTMAX_MIN );
> +
> +  puts( "Checking Overflow Case" );
> +  rtems_test_assert( status1 <= INTMAX_MAX ) ;
> +
> +  printf( "status = %jd \n" , status1 );
> +
> +  /*Test for strtoumax  */
> +  puts( "Strtoumax Testcases" );
> +  puts( "Generating Status" );
> +  status2 = strtoumax( nptr1, &endptr1, base );
> +
> +  rtems_test_assert( status2 != 0);
> +  rtems_test_assert( base != EINVAL);
> +
> +  puts( "Checking Garbage end of endptr" );
> +  rtems_test_assert( *endptr1 != '\0' );
> +
> +  puts( "Checking Overflow Case" );
> +  rtems_test_assert( status2 <= UINTMAX_MAX );
> +
> +  printf( "status = %ju \n", status2 );
> +
> +  /*Test for wcstoimax  */
> +  puts( "Wcstoimax Testcases" );
> +  puts( "Generating Status" );
> +  status1 = wcstoimax( nptr2, &endptr2, base );
> +
> +  rtems_test_assert( status1 != 0);
> +  rtems_test_assert( base != EINVAL);
> +
> +  puts( "Checking Garbage end of endptr" );
> +  rtems_test_assert( *endptr2 != '\0' );
> +
> +  puts( "Checking Underflow Case" );
> +  rtems_test_assert( status1 >= INTMAX_MIN );
> +
> +  puts( "Checking Overflow Case" );
> +  rtems_test_assert( status1 <= INTMAX_MAX ) ;
> +
> +  printf( "status = %jd \n", status1 );
> +
> +  /*Test for wcstoumax  */
> +  puts( "wcstoumax Testcases" );
> +  puts( "Generating Status" );
> +  status2 = wcstoumax( nptr2, &endptr2, base );
> +
> +  rtems_test_assert( status2 != 0);
> +  rtems_test_assert( base != EINVAL);
> +
> +  puts( "Checking Garbage end of endptr" );
> +  rtems_test_assert( *endptr2 != '\0' );
> +
> +  puts( "Checking Overflow Case" );
> +  rtems_test_assert( status2 <= UINTMAX_MAX );
> +
> +  printf( "status = %ju \n", status2 );
> +
> +
> +  TEST_END();
> +

Re: [PATCH] Avoid default RTEMS application configuration

2018-10-19 Thread Chris Johns
On 19/10/18 5:47 pm, Sebastian Huber wrote:
> - Am 18. Okt 2018 um 19:56 schrieb Chris Johns chr...@rtems.org:
> 
>> On 18/10/18 6:38 pm, Sebastian Huber wrote:
>>> Use a test body with a proper RTEMS application configuration to avoid a
>>> dependency on the default configuration.  Do not include
>>>  directly since this header file is an
>>> implementation detail.
>>>
>>> Update #3551.
>>> ---
>>>  rtems.py | 30 +-
>>>  1 file changed, 17 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/rtems.py b/rtems.py
>>> index 1b0da60..c7a1966 100644
>>> --- a/rtems.py
>>> +++ b/rtems.py
>>> @@ -259,13 +259,18 @@ def configure(conf, bsp_configure = None):
>>>  #
>>>  # Checks for various RTEMS features.
>>>  #
>>> -conf.multicheck({ 'header_name': 'rtems/score/cpuopts.h'},
>>> -msg = 'Checking for RTEMS CPU options header',
>>> -mandatory = True)
>>> -load_cpuopts(conf, ab, rtems_path)
>>
>> OK.
>>
>>> -conf.multicheck({ 'header_name': 'rtems.h'},
>>> -msg = 'Checking for RTEMS header',
>>> -mandatory = True)
>>
>> Why remove the test? I see the app test below checks for the header however 
>> the
>> test creates a nice specific error message.
> 
> The test is not a simple compile test and dosen't only check that you can 
> include . In addition it checks that you can link a sample 
> application successfully.

The test you have added is a good addition. I am asking, why not keep both
tests? It comes down to the error message and how user friendly it is. If
'rtems.h' is present we can assume it is an installed RTEMS. The second test can
check the quality of the install. I would like to avoid users needing to dig
into a config log to find an error and then try to understand it to figure out
they have a bad path on the command line.

What is the error report with just the 'main' test you added and an invalid
RTEMS path?

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel