[PATCH] sptests/spversion01: New test

Chris Johns chrisj at rtems.org
Thu May 4 06:13:27 UTC 2017


On 04/05/2017 15:31, Sebastian Huber wrote:
> ---
>  testsuites/sptests/Makefile.am                 |  1 +
>  testsuites/sptests/configure.ac                |  1 +
>  testsuites/sptests/spversion01/Makefile.am     | 19 +++++++++
>  testsuites/sptests/spversion01/init.c          | 55 ++++++++++++++++++++++++++
>  testsuites/sptests/spversion01/spversion01.doc | 11 ++++++
>  testsuites/sptests/spversion01/spversion01.scn |  2 +
>  6 files changed, 89 insertions(+)
>  create mode 100644 testsuites/sptests/spversion01/Makefile.am
>  create mode 100644 testsuites/sptests/spversion01/init.c
>  create mode 100644 testsuites/sptests/spversion01/spversion01.doc
>  create mode 100644 testsuites/sptests/spversion01/spversion01.scn
>
> diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
> index c50e757..d47bbca 100644
> --- a/testsuites/sptests/Makefile.am
> +++ b/testsuites/sptests/Makefile.am
> @@ -33,6 +33,7 @@ _SUBDIRS = \
>      spsignal_err01 spport_err01 spmsgq_err01 spmsgq_err02 spsem_err01 \
>      spsem_err02 sptask_err01 spevent_err03 sptask_err03 sptask_err02 \
>      sptask_err04 spclock_err01
> +_SUBDIRS += spversion01
>  _SUBDIRS += spfatal29
>  _SUBDIRS += spmutex01
>  _SUBDIRS += spextensions01
> diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
> index e14c937..a797d91 100644
> --- a/testsuites/sptests/configure.ac
> +++ b/testsuites/sptests/configure.ac
> @@ -36,6 +36,7 @@ AM_CONDITIONAL(HAS_SMP,test "$rtems_cv_RTEMS_SMP" = "yes")
>
>  # Explicitly list all Makefiles here
>  AC_CONFIG_FILES([Makefile
> +spversion01/Makefile
>  spmutex01/Makefile
>  spextensions01/Makefile
>  sptimerserver01/Makefile
> diff --git a/testsuites/sptests/spversion01/Makefile.am b/testsuites/sptests/spversion01/Makefile.am
> new file mode 100644
> index 0000000..73134d8
> --- /dev/null
> +++ b/testsuites/sptests/spversion01/Makefile.am
> @@ -0,0 +1,19 @@
> +rtems_tests_PROGRAMS = spversion01
> +spversion01_SOURCES = init.c
> +
> +dist_rtems_tests_DATA = spversion01.scn spversion01.doc
> +
> +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
> +include $(top_srcdir)/../automake/compile.am
> +include $(top_srcdir)/../automake/leaf.am
> +
> +AM_CPPFLAGS += -I$(top_srcdir)/../support/include
> +
> +LINK_OBJS = $(spversion01_OBJECTS)
> +LINK_LIBS = $(spversion01_LDLIBS)
> +
> +spversion01$(EXEEXT): $(spversion01_OBJECTS) $(spversion01_DEPENDENCIES)
> +	@rm -f spversion01$(EXEEXT)
> +	$(make-exe)
> +
> +include $(top_srcdir)/../automake/local.am
> diff --git a/testsuites/sptests/spversion01/init.c b/testsuites/sptests/spversion01/init.c
> new file mode 100644
> index 0000000..820feee
> --- /dev/null
> +++ b/testsuites/sptests/spversion01/init.c
> @@ -0,0 +1,55 @@
> +/*
> + * Copyright (c) 2017 embedded brains GmbH.  All rights reserved.
> + *
> + *  embedded brains GmbH
> + *  Dornierstr. 4
> + *  82178 Puchheim
> + *  Germany
> + *  <rtems at embedded-brains.de>
> + *
> + * The license and distribution terms for this file may be
> + * found in the file LICENSE in this distribution or at
> + * http://www.rtems.org/license/LICENSE.
> + */
> +
> +#ifdef HAVE_CONFIG_H
> +#include "config.h"
> +#endif
> +
> +#include <rtems.h>
> +
> +#include "tmacros.h"
> +
> +const char rtems_test_name[] = "SPVERSION 1";
> +
> +#ifndef __RTEMS_MAJOR__
> +#error "__RTEMS_MAJOR__ not defined"
> +#endif
> +
> +#ifndef __RTEMS_MINOR__
> +#error "__RTEMS_MINOR__ not defined"
> +#endif
> +
> +#ifndef __RTEMS_REVISION__
> +#error "__RTEMS_REVISION__ not defined"
> +#endif
> +
> +static void Init(rtems_task_argument arg)
> +{
> +  TEST_BEGIN();

Would adding this help verify number are used and nothing extra has been 
added by the build system?

   printf("major = %d\n",    __RTEMS_MAJOR__);
   printf("minor = %d\n",    __RTEMS_MINOR__);
   printf("revision = %d\n", __RTEMS_REVISION__);

Chris

> +  TEST_END();
> +  rtems_test_exit(0);
> +}
> +
> +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
> +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
> +
> +#define CONFIGURE_MAXIMUM_TASKS 1
> +
> +#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
> +
> +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
> +
> +#define CONFIGURE_INIT
> +
> +#include <rtems/confdefs.h>
> diff --git a/testsuites/sptests/spversion01/spversion01.doc b/testsuites/sptests/spversion01/spversion01.doc
> new file mode 100644
> index 0000000..d72e20b
> --- /dev/null
> +++ b/testsuites/sptests/spversion01/spversion01.doc
> @@ -0,0 +1,11 @@
> +This file describes the directives and concepts tested by this test set.
> +
> +test set name: spversion01
> +
> +directives:
> +
> +  None.
> +
> +concepts:
> +
> +  Ensure that the RTEMS version macros are defined.
> diff --git a/testsuites/sptests/spversion01/spversion01.scn b/testsuites/sptests/spversion01/spversion01.scn
> new file mode 100644
> index 0000000..735ed11
> --- /dev/null
> +++ b/testsuites/sptests/spversion01/spversion01.scn
> @@ -0,0 +1,2 @@
> +*** BEGIN OF TEST SPVERSION 1 ***
> +*** END OF TEST SPVERSION 1 ***
>



More information about the devel mailing list