From b02cfd32967ac42c5a79157f49025e3849156460 Mon Sep 17 00:00:00 2001
From: Chirayu Desai <cdesai@cyanogenmod.org>
Date: Fri, 6 Dec 2013 20:35:36 +0530
Subject: [PATCH] sptests: add a test for page size
Bug: https://www.rtems.org/bugzilla/show_bug.cgi?id=1216
---
testsuites/sptests/Makefile.am | 4 +--
testsuites/sptests/configure.ac | 1 +
testsuites/sptests/sppagesize/Makefile.am | 22 ++++++++++++++
testsuites/sptests/sppagesize/init.c | 45 ++++++++++++++++++++++++++++
testsuites/sptests/sppagesize/sppagesize.doc | 17 +++++++++++
testsuites/sptests/sppagesize/sppagesize.scn | 2 ++
6 files changed, 89 insertions(+), 2 deletions(-)
create mode 100644 testsuites/sptests/sppagesize/Makefile.am
create mode 100644 testsuites/sptests/sppagesize/init.c
create mode 100644 testsuites/sptests/sppagesize/sppagesize.doc
create mode 100644 testsuites/sptests/sppagesize/sppagesize.scn
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 4618d36..f440b0f 100644
a
|
b
|
SUBDIRS = \ |
26 | 26 | spintrcritical09 spintrcritical10 spintrcritical11 spintrcritical12 \ |
27 | 27 | spintrcritical13 spintrcritical14 spintrcritical15 spintrcritical16 \ |
28 | 28 | spintrcritical17 spintrcritical18 spmkdir spmountmgr01 spheapprot \ |
29 | | spsem01 spsem02 spsimplesched01 spsimplesched02 spsimplesched03 spnsext01 \ |
30 | | spedfsched01 spedfsched02 spedfsched03 \ |
| 29 | sppagesize spsem01 spsem02 spsimplesched01 spsimplesched02 \ |
| 30 | spsimplesched03 spnsext01 spedfsched01 spedfsched02 spedfsched03 \ |
31 | 31 | spcbssched01 spcbssched02 spcbssched03 spqreslib sptimespec01 |
32 | 32 | SUBDIRS += spintrcritical20 |
33 | 33 | SUBDIRS += spintrcritical19 |
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index 70e425d..69c999a 100644
a
|
b
|
spmountmgr01/Makefile |
180 | 180 | spnotepad01/Makefile |
181 | 181 | spnsext01/Makefile |
182 | 182 | spobjgetnext/Makefile |
| 183 | sppagesize/Makefile |
183 | 184 | spprintk/Makefile |
184 | 185 | spprivenv01/Makefile |
185 | 186 | spqreslib/Makefile |
diff --git a/testsuites/sptests/sppagesize/Makefile.am b/testsuites/sptests/sppagesize/Makefile.am
new file mode 100644
index 0000000..83647ef
-
|
+
|
|
| 1 | |
| 2 | rtems_tests_PROGRAMS = sppagesize |
| 3 | sppagesize_SOURCES = init.c |
| 4 | |
| 5 | dist_rtems_tests_DATA = sppagesize.scn |
| 6 | dist_rtems_tests_DATA += sppagesize.doc |
| 7 | |
| 8 | include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg |
| 9 | include $(top_srcdir)/../automake/compile.am |
| 10 | include $(top_srcdir)/../automake/leaf.am |
| 11 | |
| 12 | |
| 13 | AM_CPPFLAGS += -I$(top_srcdir)/../support/include |
| 14 | |
| 15 | LINK_OBJS = $(sppagesize_OBJECTS) |
| 16 | LINK_LIBS = $(sppagesize_LDLIBS) |
| 17 | |
| 18 | sppagesize$(EXEEXT): $(sppagesize_OBJECTS) $(sppagesize_DEPENDENCIES) |
| 19 | @rm -f sppagesize$(EXEEXT) |
| 20 | $(make-exe) |
| 21 | |
| 22 | include $(top_srcdir)/../automake/local.am |
diff --git a/testsuites/sptests/sppagesize/init.c b/testsuites/sptests/sppagesize/init.c
new file mode 100644
index 0000000..0f21aa8
-
|
+
|
|
| 1 | /* |
| 2 | * COPYRIGHT (c) 1989-2011. |
| 3 | * On-Line Applications Research Corporation (OAR). |
| 4 | * |
| 5 | * The license and distribution terms for this file may be |
| 6 | * found in the file LICENSE in this distribution or at |
| 7 | * http://www.rtems.com/license/LICENSE. |
| 8 | */ |
| 9 | |
| 10 | #ifdef HAVE_CONFIG_H |
| 11 | #include "config.h" |
| 12 | #endif |
| 13 | |
| 14 | #include <tmacros.h> |
| 15 | #include <rtems.h> |
| 16 | #include <limits.h> |
| 17 | #include <sys/param.h> |
| 18 | |
| 19 | /* forward declarations to avoid warnings */ |
| 20 | rtems_task Init(rtems_task_argument argument); |
| 21 | |
| 22 | rtems_task Init( |
| 23 | rtems_task_argument argument |
| 24 | ) |
| 25 | { |
| 26 | puts("\n\n*** TEST SPPAGESIZE ***"); |
| 27 | |
| 28 | rtems_test_assert(PAGESIZE == PAGE_SIZE); |
| 29 | rtems_test_assert(getpagesize() == PAGE_SIZE); |
| 30 | |
| 31 | puts("*** END OF TEST SPPAGESIZE ***"); |
| 32 | |
| 33 | rtems_test_exit(0); |
| 34 | } |
| 35 | |
| 36 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
| 37 | #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER |
| 38 | |
| 39 | #define CONFIGURE_MAXIMUM_TASKS 1 |
| 40 | |
| 41 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
| 42 | |
| 43 | #define CONFIGURE_INIT |
| 44 | |
| 45 | #include <rtems/confdefs.h> |
diff --git a/testsuites/sptests/sppagesize/sppagesize.doc b/testsuites/sptests/sppagesize/sppagesize.doc
new file mode 100644
index 0000000..696d1fa
-
|
+
|
|
| 1 | # COPYRIGHT (c) 1989-2011. |
| 2 | # On-Line Applications Research Corporation (OAR). |
| 3 | # |
| 4 | # The license and distribution terms for this file may be |
| 5 | # found in the file LICENSE in this distribution or at |
| 6 | # http://www.rtems.com/license/LICENSE. |
| 7 | # |
| 8 | |
| 9 | test name: sppagesize |
| 10 | |
| 11 | directives: |
| 12 | getpagesize |
| 13 | |
| 14 | concepts: |
| 15 | |
| 16 | + Verifies that the different declarations of pagesize have |
| 17 | the same value |
diff --git a/testsuites/sptests/sppagesize/sppagesize.scn b/testsuites/sptests/sppagesize/sppagesize.scn
new file mode 100644
index 0000000..2468e04
-
|
+
|
|
| 1 | *** TEST SPPAGESIZE *** |
| 2 | *** END OF TEST SPPAGESIZE *** |