Ticket #1216: 0001-sptests-add-a-test-for-page-size_v1.patch

File 0001-sptests-add-a-test-for-page-size_v1.patch, 5.0 KB (added by Chirayu Desai, on 12/06/13 at 14:34:32)

Testcase for pagesize (2)

  • testsuites/sptests/Makefile.am

    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 = \ 
    2626    spintrcritical09 spintrcritical10 spintrcritical11 spintrcritical12 \
    2727    spintrcritical13 spintrcritical14 spintrcritical15 spintrcritical16 \
    2828    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 \
    3131    spcbssched01 spcbssched02 spcbssched03 spqreslib sptimespec01
    3232SUBDIRS += spintrcritical20
    3333SUBDIRS += spintrcritical19
  • testsuites/sptests/configure.ac

    diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
    index 70e425d..69c999a 100644
    a b spmountmgr01/Makefile 
    180180spnotepad01/Makefile
    181181spnsext01/Makefile
    182182spobjgetnext/Makefile
     183sppagesize/Makefile
    183184spprintk/Makefile
    184185spprivenv01/Makefile
    185186spqreslib/Makefile
  • new file testsuites/sptests/sppagesize/Makefile.am

    diff --git a/testsuites/sptests/sppagesize/Makefile.am b/testsuites/sptests/sppagesize/Makefile.am
    new file mode 100644
    index 0000000..83647ef
    - +  
     1
     2rtems_tests_PROGRAMS = sppagesize
     3sppagesize_SOURCES = init.c
     4
     5dist_rtems_tests_DATA = sppagesize.scn
     6dist_rtems_tests_DATA += sppagesize.doc
     7
     8include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
     9include $(top_srcdir)/../automake/compile.am
     10include $(top_srcdir)/../automake/leaf.am
     11
     12
     13AM_CPPFLAGS += -I$(top_srcdir)/../support/include
     14
     15LINK_OBJS = $(sppagesize_OBJECTS)
     16LINK_LIBS = $(sppagesize_LDLIBS)
     17
     18sppagesize$(EXEEXT): $(sppagesize_OBJECTS) $(sppagesize_DEPENDENCIES)
     19        @rm -f sppagesize$(EXEEXT)
     20        $(make-exe)
     21
     22include $(top_srcdir)/../automake/local.am
  • new file testsuites/sptests/sppagesize/init.c

    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 */
     20rtems_task Init(rtems_task_argument argument);
     21
     22rtems_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>
  • new file testsuites/sptests/sppagesize/sppagesize.doc

    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
     9test name:  sppagesize
     10
     11directives:
     12  getpagesize
     13
     14concepts:
     15
     16+ Verifies that the different declarations of pagesize have
     17  the same value
  • new file testsuites/sptests/sppagesize/sppagesize.scn

    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 ***