[rtems commit] fixed psxtmthread02 test, updated . csv to be in sync and added test .docs

Joel Sherrill joel at rtems.org
Sat Nov 30 22:00:59 UTC 2013


Module:    rtems
Branch:    master
Commit:    115e0591317481cb622913d46f4164d7db34fa1b
Changeset: http://git.rtems.org/rtems/commit/?id=115e0591317481cb622913d46f4164d7db34fa1b

Author:    Daniel Ramirez <javamonn at gmail.com>
Date:      Sat Nov 30 15:42:38 2013 -0600

fixed psxtmthread02 test, updated .csv to be in sync and added test .docs

---

 testsuites/psxtests/psxspin01/psxspin01.doc        |   21 ++++++++++++
 testsuites/psxtmtests/psxtmbarrier03/init.c        |    2 +-
 testsuites/psxtmtests/psxtmcond02/psxtmcond02.doc  |   14 +++++++-
 testsuites/psxtmtests/psxtmcond03/psxtmcond03.doc  |   19 ++++++++++-
 testsuites/psxtmtests/psxtmcond05/psxtmcond05.doc  |   14 +++++++-
 testsuites/psxtmtests/psxtmcond08/psxtmcond08.doc  |   20 ++++++++++-
 testsuites/psxtmtests/psxtmtests_plan.csv          |   29 ++++++++---------
 testsuites/psxtmtests/psxtmthread02/init.c         |   34 ++++++++++---------
 .../psxtmtests/psxtmthread02/psxtmthread02.doc     |   14 +++++++-
 9 files changed, 126 insertions(+), 41 deletions(-)

diff --git a/testsuites/psxtests/psxspin01/psxspin01.doc b/testsuites/psxtests/psxspin01/psxspin01.doc
new file mode 100644
index 0000000..d9a025f
--- /dev/null
+++ b/testsuites/psxtests/psxspin01/psxspin01.doc
@@ -0,0 +1,21 @@
+#  COPYRIGHT (c) 1989-2009.
+#  On-Line Applications Research Corporation (OAR).
+#
+#  The license and distribution terms for this file may be
+#  found in the file LICENSE in this distribution or at
+#  http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name:  psxspin
+
+directives:
+
+  pthread_spin_init
+  pthread_spin_destroy
+
+concepts:
+
++ Ensure that proper error values result when passing different combinations of
+  values to pthread_spin_init and pthread_spin_destroy
diff --git a/testsuites/psxtmtests/psxtmbarrier03/init.c b/testsuites/psxtmtests/psxtmbarrier03/init.c
index 4b924c8..0ec7c63 100644
--- a/testsuites/psxtmtests/psxtmbarrier03/init.c
+++ b/testsuites/psxtmtests/psxtmbarrier03/init.c
@@ -68,7 +68,7 @@ void *POSIX_Init(
    * unblocking operation.
    */
   benchmark_timer_initialize();
-    status = pthread_barrier_wait( &barrier );
+  status = pthread_barrier_wait( &barrier );
   end_time = benchmark_timer_read();
   /*
    * Upon successful completion return value, the status should be
diff --git a/testsuites/psxtmtests/psxtmcond02/psxtmcond02.doc b/testsuites/psxtmtests/psxtmcond02/psxtmcond02.doc
index 865fc07..72ea1bb 100644
--- a/testsuites/psxtmtests/psxtmcond02/psxtmcond02.doc
+++ b/testsuites/psxtmtests/psxtmcond02/psxtmcond02.doc
@@ -1,4 +1,4 @@
-#  COPYRIGHT (c) 1989-2011.
+#  COPYRIGHT (c) 2013
 #  On-Line Applications Research Corporation (OAR).
 #
 #  The license and distribution terms for this file may be
@@ -8,4 +8,14 @@
 
 This test benchmarks the following operations:
 
-+ 
++ pthread_cond_signal - no threads waiting
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: psxtmcond
+
+directives:
++ pthread_cond_signal
+
+concepts:
++ Benchmark the call pthread_cond_signal with no threads waiting.
diff --git a/testsuites/psxtmtests/psxtmcond03/psxtmcond03.doc b/testsuites/psxtmtests/psxtmcond03/psxtmcond03.doc
index 865fc07..4f0a474 100644
--- a/testsuites/psxtmtests/psxtmcond03/psxtmcond03.doc
+++ b/testsuites/psxtmtests/psxtmcond03/psxtmcond03.doc
@@ -1,4 +1,4 @@
-#  COPYRIGHT (c) 1989-2011.
+#  COPYRIGHT (c) 2013
 #  On-Line Applications Research Corporation (OAR).
 #
 #  The license and distribution terms for this file may be
@@ -8,4 +8,19 @@
 
 This test benchmarks the following operations:
 
-+ 
++ pthread_cond_signal - thread waiting: no preempt
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: psxtmcond
+
+directives:
++ pthread_cond_signal
++ pthread_mutex_lock
++ pthread_mutex_init
++ pthread_cond_init
++ pthread_create
+
+concepts:
++ Benchmark the call pthread_cond_signal to unlock a mutex, with no resulting
+  preempt.
diff --git a/testsuites/psxtmtests/psxtmcond05/psxtmcond05.doc b/testsuites/psxtmtests/psxtmcond05/psxtmcond05.doc
index 865fc07..ab6bcd1 100644
--- a/testsuites/psxtmtests/psxtmcond05/psxtmcond05.doc
+++ b/testsuites/psxtmtests/psxtmcond05/psxtmcond05.doc
@@ -1,4 +1,4 @@
-#  COPYRIGHT (c) 1989-2011.
+#  COPYRIGHT (c) 2013
 #  On-Line Applications Research Corporation (OAR).
 #
 #  The license and distribution terms for this file may be
@@ -8,4 +8,14 @@
 
 This test benchmarks the following operations:
 
-+ 
++ pthread_cond_broadcast - no threads waiting
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: psxtmcond
+
+directives:
++ pthread_cond_broadcast
+
+concepts:
++ Benchmark the call pthread_cond_broadcast with no threads waiting.
diff --git a/testsuites/psxtmtests/psxtmcond08/psxtmcond08.doc b/testsuites/psxtmtests/psxtmcond08/psxtmcond08.doc
index 865fc07..9925b95 100644
--- a/testsuites/psxtmtests/psxtmcond08/psxtmcond08.doc
+++ b/testsuites/psxtmtests/psxtmcond08/psxtmcond08.doc
@@ -1,4 +1,4 @@
-#  COPYRIGHT (c) 1989-2011.
+#  COPYRIGHT (c) 2013
 #  On-Line Applications Research Corporation (OAR).
 #
 #  The license and distribution terms for this file may be
@@ -8,4 +8,20 @@
 
 This test benchmarks the following operations:
 
-+ 
++ pthread_cond_wait - blocks (mutex+condvar pattern)
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: psxtmcond
+
+directives:
++ pthread_cond_signal
++ pthread_mutex_lock
++ pthread_mutex_init
++ pthread_cond_init
++ pthread_create
++ pthread_cond_timedwait
+
+concepts:
++ Benchmark the call pthread_cond_wait blocking threads and using a mutex and
+  condvar pattern.
diff --git a/testsuites/psxtmtests/psxtmtests_plan.csv b/testsuites/psxtmtests/psxtmtests_plan.csv
index afc0763..c89fbcc 100644
--- a/testsuites/psxtmtests/psxtmtests_plan.csv
+++ b/testsuites/psxtmtests/psxtmtests_plan.csv
@@ -13,26 +13,25 @@
 "pthread_mutex_setprioceiling","psxtmmutex07","psxtmtest_single","Yes"
 "pthread_mutex_getprioceiling","psxtmmutex07","psxtmtest_single","Yes"
 ,,,
-"pthread_cond_init","psxtmcond01","psxtmtest_init_destroy","No"
-"pthread_cond_destroy","psxtmcond01","psxtmtest_init_destroy","No"
-"pthread_cond_signal - no threads waiting","psxtmcond02","psxtmtest_single","No"
-"pthread_cond_signal - thread waiting: no preempt","psxtmcond03","psxtmtest_unblocking_nopreempt","No"
+"pthread_cond_init","psxtmcond01","psxtmtest_init_destroy","Yes"
+"pthread_cond_destroy","psxtmcond01","psxtmtest_init_destroy","Yes"
+"pthread_cond_signal - no threads waiting","psxtmcond02","psxtmtest_single","Yes"
+"pthread_cond_signal - thread waiting: no preempt","psxtmcond03","psxtmtest_unblocking_nopreempt","Yes"
 "pthread_cond_signal - thread waiting: preempt","psxtmcond04","psxtmtest_unblocking_preempt","No"
-"pthread_cond_broadcast - no threads waiting","psxtmcond05","psxtmtest_single","No"
+"pthread_cond_broadcast - no threads waiting","psxtmcond05","psxtmtest_single","Yes"
 "pthread_cond_broadcast -  threads waiting: no preempt","psxtmcond06","psxtmtest_unblocking_nopreempt","No"
 "pthread_cond_broadcast -  threads waiting: preempt","psxtmcond07","psxtmtest_unblocking_preempt","No"
 
-"pthread_cond_wait - blocks (mutex+condvar pattern)","psxtmcond08","psxtmtest_blocking","No"
+"pthread_cond_wait - blocks (mutex+condvar pattern)","psxtmcond08","psxtmtest_blocking","Yes"
 "pthread_cond_timedwait(&time) - blocks (mutex+condvar pattern)","psxtmcond09","psxtmtest_blocking","No"
 "pthread_cond_timedwait(&time) - time in past error","psxtmcond10","psxtmtest_blocking","No"
 ,,,
 "pthread_create - no preempt","psxtmthread01","psxtmtest_single","Yes"
-"pthread_create - preempt","psxtmthread02","psxtmtest_single","No"
+"pthread_create - preempt","psxtmthread02","psxtmtest_single","Yes"
 "pthread_join",,,
 "pthread_detach",,,
 "pthread_exit",,,
-"pthread_self","psxtmthread03","psxtmtest_single w/multiple timings","No"
-"pthread_equal","psxtmthread03","psxtmtest_single w/multiple timings","No"
+"pthread_exit","psxtmthread03","psxtmtest_single","Yes"
 "pthread_getschedparam","psxtmthread04","psxtmtest_single w/multiple timings","No"
 "pthread_setschedparam - no thread switch","psxtmthread04","psxtmtest_single w/multiple timings","No"
 "pthread_setschedparam - lower own priority: preempt","psxtmthread05","psxtmtest_single","Yes"
@@ -61,12 +60,12 @@
 "pthread_barrier_wait - releasing: no preempt","psxtmbarrier03","psxtmtest_unblocking_nopreempt","Yes"
 "pthread_barrier_wait - releasing: preempt","psxtmbarrier04","psxtmtest_unblocking_preempt","Yes"
 ,,,
-"pthread_spin_init","psxspin01","psxtmtest_init_destroy","No"
-"pthread_spin_destroy","psxspin01","psxtmtest_init_destroy","No"
-"pthread_spin_lock - available","psxspin02","psxtmtest_single w/multiple timings","No"
-"pthread_spin_trylock - available","psxspin02","psxtmtest_single w/multiple timings","No"
-"pthread_spin_trylock - not available","psxspin02","psxtmtest_single w/multiple timings","No"
-"pthread_spin_unlock","psxspin02","psxtmtest_single w/multiple timings","No"
+"pthread_spin_init","psxspin01","psxtmtest_init_destroy","Yes"
+"pthread_spin_destroy","psxspin01","psxtmtest_init_destroy","Yes"
+"pthread_spin_lock - available","psxspin02","psxtmtest_single w/multiple timings","Yes"
+"pthread_spin_trylock - available","psxspin02","psxtmtest_single w/multiple timings","Yes"
+"pthread_spin_trylock - not available","psxspin02","psxtmtest_single w/multiple timings","Yes"
+"pthread_spin_unlock","psxspin02","psxtmtest_single w/multiple timings","Yes"
 ,,,
 "pthread_rwlock_init","psxtmrwlock01","psxtmtest_init_destroy","Yes"
 "pthread_rwlock_destroy","psxtmrwlock01","psxtmtest_init_destroy","Yes"
diff --git a/testsuites/psxtmtests/psxtmthread02/init.c b/testsuites/psxtmtests/psxtmthread02/init.c
index 9e44873..bfa3ab8 100644
--- a/testsuites/psxtmtests/psxtmthread02/init.c
+++ b/testsuites/psxtmtests/psxtmthread02/init.c
@@ -1,5 +1,5 @@
 /*
- *  COPYRIGHT (c) 1989-2012.
+ *  COPYRIGHT (c) 1989-2013.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
@@ -23,19 +23,29 @@ void *thread(void *argument);
 
 void benchmark_pthread_create(void)
 {
-  long end_time;
   int  status;
   pthread_t thread_ID;
+  pthread_attr_t attr;
+  struct sched_param param;
+
+  pthread_attr_init(&attr);
+  pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
+  pthread_attr_setschedpolicy(&attr, SCHED_FIFO);
+  param.sched_priority = sched_get_priority_max(SCHED_FIFO) - 1;
+  pthread_attr_setschedparam(&attr, &param);
 
+  /* create second thread with max priority and get preempted on creation */
   benchmark_timer_initialize();
-  
-  status = pthread_create(&thread_ID, NULL, thread, NULL);
-  rtems_test_assert( status == 0 );
- 
-  end_time = benchmark_timer_read();
+  status = pthread_create(&thread_ID, &attr, thread, NULL);
+}
 
-  rtems_test_assert( status == 0 );
+void *thread(
+  void *argument
+)
+{
+  long end_time;
 
+  end_time = benchmark_timer_read();
   put_time(
     "pthread_create - preempt",
     end_time,
@@ -43,14 +53,6 @@ void benchmark_pthread_create(void)
     0,
     0
   );
-
-}
-
-void *thread(
-  void *argument
-)
-{
-  //Empty thread used in pthread_create().
   return NULL;
 }
 
diff --git a/testsuites/psxtmtests/psxtmthread02/psxtmthread02.doc b/testsuites/psxtmtests/psxtmthread02/psxtmthread02.doc
index 865fc07..0e2e18c 100644
--- a/testsuites/psxtmtests/psxtmthread02/psxtmthread02.doc
+++ b/testsuites/psxtmtests/psxtmthread02/psxtmthread02.doc
@@ -1,5 +1,6 @@
 #  COPYRIGHT (c) 1989-2011.
 #  On-Line Applications Research Corporation (OAR).
+#  COPYRIGHT (c) 2013.
 #
 #  The license and distribution terms for this file may be
 #  found in the file LICENSE in this distribution or at
@@ -8,4 +9,15 @@
 
 This test benchmarks the following operations:
 
-+ 
++ pthread_create - preempt
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: psxtmthread
+
+directives:
++ pthread_create
+
+concepts:
++ Benchmark the call pthread_create for creating a thread with a higher priority
+  and the resulting preempt.




More information about the vc mailing list