Changes between Initial Version and Version 1 of GCI/Coding/AddPOSIXMethodSignatureComplianceTests


Ignore:
Timestamp:
11/14/18 19:22:47 (5 years ago)
Author:
Joel Sherrill
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GCI/Coding/AddPOSIXMethodSignatureComplianceTests

    v1 v1  
     1= Add POSIX Method Signature Compliance Tests =
     2
     3[[TOC(AddPOSIXMethodSignatureComplianceTests, depth=2)]]
     4
     5== Directions for Students ==
     6
     7**Prerequisite**: You '''must''' have completed the "Getting Started: Hello World" task or equivalently done the [wiki:GSoC/GettingStarted GSoC Getting Started Guide] before attempting this task.
     8
     9===  Creating a Test  ===
     10
     11To create a test, you'll need to be in the rtems/testsuite/psxtests/psxheader/@your_header@ directory. Note that the @your_header@ directory will be the name of the header file without the .h. For example, stdio.h related tests will be in psxtests/psxhdr/stdio and those for sys/mman.h are in sys/mman.
     12
     13For the header file you have been given, you will be creating a simple test case that verifies that RTEMS matches the POSIX defined signature of the method as defined at XXX. Search for the header file you have been assigned and check every method that is in it. For each method, its specification page will have something like this (from time()):
     14
     15{{{
     16}}}
     17
     18The test for time() is in psxtests/psxhdr/time/time.c and (ignoring comments and boilerplate) is as follows:
     19
     20{{{
     21#ifdef HAVE_CONFIG_H
     22#include "config.h"
     23#endif
     24
     25#include <time.h>
     26
     27int test( void );
     28
     29int test( void )
     30{
     31  time_t    new_time;
     32
     33  new_time = time( &new_time );
     34
     35  return (new_time != -1);
     36}
     37}}}
     38
     39Note that a variable of each time passed in and returned is declared. The POSIX standard told us that time() could be invoked by including only the <time.h> header file and this test verifies that RTEMS follows the standard.
     40
     41Each header file has multiple methods. Each goes in a separate file.
     42
     43Use other existing tests as guides but note that some do not follow the proper Doxygen style expected now in RTEMS. Please use current style.
     44
     45Also some use the RTEMS GPL v2 with exception license. Use the BSD style license found here: https://git.rtems.org/rtems-testing/tree/rtems-test-template/psxtest/init.c
     46
     47===  Adding the Test to the Build System  ===
     48
     49To add a test to the build system, you'll need to add it to psxtests/Makefile.am. Search for psxhdrs in the Makefile.am and then just add your new files to the list.
     50
     51Then you'll need to "bootstrap" from the psxtests directory.
     52
     53Now bootstrap it
     54{{{
     55 cd ~/rtems/testsuites/psxtests
     56 ~/rtems> ../../bootstrap
     57}}}
     58
     59Now build...
     60{{{
     61 cd ../b-erc32
     62 ../rtems/configure --options --used --to --configure
     63}}}
     64
     65Be sure to include --enable-tests on the configure command.
     66
     67These tests are compile only and are not intended to be executed.
     68
     69== Directions for Mentors ==
     70
     71This should be evaluated as a normal code submission. You need to review and verify the tests compile warning free to ensure it is correct. These are compile-only tests. It should be based on the templates in rtems-testing. The student should provide a name and email for proper attribution. If you have write permission, commit it. Otherwise, send it to devel@rtems.org for another developer to commit with commentary indicating it is acceptable and from GCI.
     72
     73Ensure the license and Doxygen file headers are correct.
     74
     75Ensure it is using a BSD-0 style license.
     76