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


Ignore:
Timestamp:
11/17/15 19:11:42 (8 years ago)
Author:
Gedare Bloom
Comment:

Import from GCI/Projects

Legend:

Unmodified
Added
Removed
Modified
  • GCI/Coding/POSIXTimingTest

    v1 v1  
     1= Create a POSIX Timing Test =
     2
     3[[TOC(GCI/POSIXTimingTest , depth=2)]]
     4
     5
     6===  Invoking rtems-testing/rtems-test-template/mktest  ===
     7
     8To create a test, you'll need to be in the rtems/testsuite/your_pattern directory.
     9This task consists of adding a benchmark test to the RTEMS POSIX Timing Test Suite.  There are templates for each benchmark pattern we have identified.  The task consists of identifying the correct pattern, instantiating it using the "mktest" script, and then filling that in with the appropriate calls.
     10For example:
     11 ~/rtems/testsuites/psxtmtests>
     12
     13You'll need to specify the source (-s), the destination (-d), and the test number (-n). Change the location to match where you put rtems-testing. For example:
     14
     15 ~/rtems/testsuites/psxtmtests> ~/rtems-testing/rtems-test-template/mktest \
     16 -s ~/rtems-testing/rtems-test-template/psxtmtest_unblocking_preempt \
     17 -d psxtmcond04 \
     18 -n 4
     19===  Adding the Test to the Build System  ===
     20
     21To add a test to the build system, you'll need to add it to configure.ac and Makefile.am.  Then you'll need to ./bootstrap it.
     22
     23Changes to Makefile.am
     24                           rtems/testsuites/psxtmtests/Makefile.am
     25  SUBDIRS += psxtmthread01
     26  SUBDIRS += psxtmthread03
     27  SUBDIRS += psxtmcond04 # Add a SUBDIRS entry to the bottom
     28 endif
     29
     30Changes to configure.ac
     31                           rtems/testsuites/psxtmtests/configure.ac
     32  psxtmthread01/Makefile
     33  psxtmthread03/Makefile
     34  psxtmcond04/Makefile
     35 ])
     36 AC_OUTPUT
     37
     38Now bootstrap it
     39
     40 cd ~/rtems
     41 ~/rtems> ./bootstrap
     42
     43Now build...
     44
     45 cd ../b-sis
     46 ../rtems/configure --options --used --to --configure
     47===  Finding an Example  ===
     48
     49Now that the test has been added to the build system, find working examples of the functions to call.  One way to do that is to use grep -r.  From the terminal, there may be characters that have to be "escaped" \. For example to create a test of pthread_cond_init() put the following in the command line:
     50 grep -r pthread\_cond\_init ~/rtems/testsuites/
     51===  !Simulator/Emulator  ===
     52
     53Finally use a simulator/emulator
     54See http://www.rtems.org/wiki/index.php/Quick_Start
     55===  Lather, Rinse, Repeat  ===
     56
     57Add all the #includes, at the top, compare the macros at the bottom, cut-and-paste from working example of the source code into the generated test, see what happens.
     58
     59After each change, clean the build directory, rebuild the source, and try again, depending on the simulator something like:
     60
     61 ~/b-sis make clean
     62 ~/b-sis ../rtems/configure --options --to --configure
     63 ~/b-sis make
     64 ~/b-sis sparc-rtems4.11-gdb `find . -name ticker.exe`
     65
     66This is a particularly challenging task, so asking questions, and making suggestions for improving the directions on this task would be greatly appreciated.
     67===  Posix Time Test Plan (for generating more GCI tasks)  ===
     68
     69
     70This task can be instantiated for multiple areas in POSIX but the following is a typical set for communications and synchronization objects.  A GSOC 2011 project implemented many tests for semaphores, message queues, etc., but there are still many left to implement.  The following is a link to the Comma Separated Value (e.g., .csv) file which is exported from the spreadsheet used to track the status of this effort.
     71
     72 *  http://git.rtems.org/rtems/tree/testsuites/psxtmtests/psxtmtests_plan.csv
     73There are likely 50-100 instances of this task possible.
     74
     75=== Mentor Guidelines ===
     76This should be evaluated as a normal code submission. You need to review and run the test to ensure it is correct. It should be based upon 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 rtems-devel for another developer to commit with commentary indicating it is acceptable and from GCI.