[PATCH] cpukit: Fix __RTEMS_REVISION__ define

Sebastian Huber sebastian.huber at embedded-brains.de
Tue May 2 08:20:57 UTC 2017


---
 cpukit/configure.ac                            |  2 +-
 testsuites/sptests/Makefile.am                 |  1 +
 testsuites/sptests/configure.ac                |  1 +
 testsuites/sptests/spversion01/Makefile.am     | 19 +++++++++
 testsuites/sptests/spversion01/init.c          | 53 ++++++++++++++++++++++++++
 testsuites/sptests/spversion01/spversion01.doc | 11 ++++++
 testsuites/sptests/spversion01/spversion01.scn |  2 +
 7 files changed, 88 insertions(+), 1 deletion(-)
 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/cpukit/configure.ac b/cpukit/configure.ac
index 67237e9..b0aa9a0 100644
--- a/cpukit/configure.ac
+++ b/cpukit/configure.ac
@@ -289,7 +289,7 @@ RTEMS_CPUOPT([__RTEMS_MINOR__],
   [$rtems_minor],
   [minor version portion of an RTEMS release])
 
-RTEMS_CPUOPT([__RTEMS_REVISION___],
+RTEMS_CPUOPT([__RTEMS_REVISION__],
   [true],
   [$rtems_revision],
   [revision version portion of an RTEMS release])
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..f3ea708
--- /dev/null
+++ b/testsuites/sptests/spversion01/init.c
@@ -0,0 +1,53 @@
+/*
+ * 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";
+
+static void test(void)
+{
+  rtems_test_assert(__RTEMS_MAJOR__ == 4);
+  rtems_test_assert(__RTEMS_MINOR__ == 11);
+  rtems_test_assert(__RTEMS_REVISION__ == 99);
+}
+
+static void Init(rtems_task_argument arg)
+{
+  TEST_BEGIN();
+
+  test();
+
+  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..9a842f4
--- /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 properly 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 ***
-- 
1.8.4.5



More information about the devel mailing list