Changeset e83be28 in rtems


Ignore:
Timestamp:
Jan 9, 2014, 11:57:08 PM (6 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.11, master
Children:
5b85cca
Parents:
e327e69
Message:

testsuite/rtems++: Output format change.

Alter the output to avoid sending out what is the MI protocol. The SIS
simulator is currently broken and outputs directly to GDB's stdout and
so this output gets parsed as MI output.

Location:
testsuites/libtests/rtems++
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/rtems++/Task1.cc

    re327e69 re83be28  
    4949{
    5050  rtems_test_pause_and_screen_number(1);
    51  
    52   printf(" * START Task Class test *\n");
    53  
     51
     52  printf(" START Task Class test\n");
     53
    5454  printf("%s - test argument - ", name_string());
    5555  if (argument != 0xDEADDEAD)
     
    5757  else
    5858    printf("argument matched\n");
    59  
     59
    6060  screen1();
    6161  rtems_test_pause_and_screen_number(2);
     
    6363  screen2();
    6464  rtems_test_pause_and_screen_number(3);
    65  
     65
    6666  screen3();
    6767  rtems_test_pause_and_screen_number(4);
    68  
     68
    6969  screen4();
    7070  rtems_test_pause_and_screen_number(5);
    71  
     71
    7272  screen5();
    7373  rtems_test_pause_and_screen_number(6);
    74  
     74
    7575  screen6();
    7676
     
    7878  // the static destructor call delete the task which is calling exit
    7979  // so exit never completes
    80  
     80
    8181  EndTask end_task("ENDT", (rtems_task_priority) 1, RTEMS_MINIMUM_STACK_SIZE * 6);
    8282  end_task.start(0);
     
    8484  rtemsEvent block_me;
    8585  rtems_event_set out;
    86  
     86
    8787  block_me.receive(RTEMS_SIGNAL_0, out);
    8888
     
    9797
    9898  local_task_2 = *this;
    99  
     99
    100100  // check the copy constructor works
    101101  printf("%s - copy constructor - ", name_string());
     
    122122  else
    123123    printf("local and this name's do not match\n");
    124  
     124
    125125  // check that the owner of the id cannot delete this task
    126126  printf("%s - not owner destroy's task - ", local_task_1.name_string());
    127127  local_task_1.destroy();
    128128  printf("%s\n", local_task_1.last_status_string());
    129  
     129
    130130  // connect to a valid task
    131131  printf("%s - connect to a local valid task name - ", local_task_2.name_string());
    132132  local_task_2.connect("TA1 ", RTEMS_SEARCH_ALL_NODES);
    133133  printf("%s\n", local_task_2.last_status_string());
    134  
     134
    135135  // connect to an invalid task
    136136  printf("%s - connect to an invalid task name - ", local_task_2.name_string());
    137137  local_task_2.connect("BADT", RTEMS_SEARCH_ALL_NODES);
    138138  printf("%s\n", local_task_2.last_status_string());
    139  
     139
    140140  // connect to a task an invalid node
    141141  printf("%s - connect to a task on an invalid node - ", local_task_2.name_string());
    142142  local_task_2.connect("BADT", 10);
    143143  printf("%s\n", local_task_2.last_status_string());
    144  
     144
    145145  // restart this task
    146146  printf("%s - restart from a non-owner - ", name_string());
     
    152152{
    153153  // wake after using this object
    154  
     154
    155155  printf("%s - wake after 0 secs - ", name_string());
    156156  wake_after(0);
    157157  printf("%s\n", last_status_string());
    158  
     158
    159159  printf("%s - wake after 500 msecs - ", name_string());
    160160  wake_after(500000);
    161161  printf("%s\n", last_status_string());
    162  
     162
    163163  printf("%s - wake after 5 secs - ", name_string());
    164164  wake_after(5000000);
     
    168168
    169169  rtemsTask task_1 = *this;
    170  
     170
    171171  // wake after using a connected object
    172  
     172
    173173  printf("%s - connected object wake after 0 secs - ", task_1.name_string());
    174174  task_1.wake_after(0);
    175175  printf("%s\n", task_1.last_status_string());
    176  
     176
    177177  printf("%s - connected object wake after 500 msecs - ", task_1.name_string());
    178178  task_1.wake_after(500000);
    179179  printf("%s\n", task_1.last_status_string());
    180  
     180
    181181  printf("%s - connected object wake after 5 secs - ", task_1.name_string());
    182182  task_1.wake_after(5000000);
     
    186186
    187187  rtemsTask task_2;
    188  
     188
    189189  // wake after using a self object
    190  
     190
    191191  printf("%s - self object wake after 0 secs - ", task_2.name_string());
    192192  task_2.wake_after(0);
    193193  printf("%s\n", task_2.last_status_string());
    194  
     194
    195195  printf("%s - self object wake after 500 msecs - ", task_2.name_string());
    196196  task_2.wake_after(500000);
    197197  printf("%s\n", task_2.last_status_string());
    198  
     198
    199199  printf("%s - self object wake after 5 secs - ", task_2.name_string());
    200200  task_2.wake_after(5000000);
     
    207207
    208208  // priorities with this object
    209  
     209
    210210  printf("%s - get priority - ", name_string());
    211211  get_priority(current_priority);
     
    225225
    226226  // priorities with connected object
    227    
     227
    228228  printf("%s - connected object get priority - ", task_1.name_string());
    229229  task_1.get_priority(current_priority);
     
    240240  printf("%s - connected object set priority to original - ", task_1.name_string());
    241241  task_1.set_priority(current_priority, priority);
    242   printf("%s, priority was %" PRIirtems_task_priority "\n", task_1.last_status_string(), priority); 
     242  printf("%s, priority was %" PRIirtems_task_priority "\n", task_1.last_status_string(), priority);
    243243
    244244  // priorities with self object
    245    
     245
    246246  printf("%s - self object get priority - ", task_2.name_string());
    247247  task_2.get_priority(current_priority);
     
    262262  uint32_t   current_note;
    263263  uint32_t   note;
    264  
     264
    265265  // notepad registers for this object
    266266
     
    329329  printf("%s\n", task_2.last_status_string());
    330330
    331   printf(" * END Task Class test *\n");
     331  printf(" END Task Class test\n");
    332332}
    333333
     
    339339void Task1::screen3(void)
    340340{
    341   printf(" * START TaskMode Class test *\n");
     341  printf(" START TaskMode Class test\n");
    342342
    343343  rtemsTask self;
     
    353353
    354354  // PREEMPTION mode control
    355  
     355
    356356  printf("%s - get preemption state - ", self.name_string());
    357357  task_mode.get_preemption_state(mode);
     
    359359  print_mode(mode, RTEMS_PREEMPT_MASK);
    360360  printf("\n");
    361  
     361
    362362  printf("%s - set preemption state to RTEMS_PREEMPT - ", self.name_string());
    363363  task_mode.set_preemption_state(RTEMS_PREEMPT);
     
    366366  print_mode(mode, RTEMS_ALL_MODES);
    367367  printf("\n");
    368  
     368
    369369  printf("%s - set preemption state to RTEMS_NO_PREEMPT - ", self.name_string());
    370370  task_mode.set_preemption_state(RTEMS_NO_PREEMPT);
     
    375375
    376376  // TIMESLICE mode control
    377  
     377
    378378  printf("%s - get timeslice state - ", self.name_string());
    379379  task_mode.get_timeslice_state(mode);
     
    381381  print_mode(mode, RTEMS_TIMESLICE_MASK);
    382382  printf("\n");
    383  
     383
    384384  printf("%s - set timeslice state to RTEMS_TIMESLICE - ", self.name_string());
    385385  task_mode.set_timeslice_state(RTEMS_TIMESLICE);
     
    388388  print_mode(mode, RTEMS_ALL_MODES);
    389389  printf("\n");
    390  
     390
    391391  printf("%s - set timeslice state to RTEMS_NO_TIMESLICE - ", self.name_string());
    392392  task_mode.set_timeslice_state(RTEMS_NO_TIMESLICE);
     
    397397
    398398  // ASR mode control
    399  
     399
    400400  printf("%s - get asr state - ", self.name_string());
    401401  task_mode.get_asr_state(mode);
     
    403403  print_mode(mode, RTEMS_ASR_MASK);
    404404  printf("\n");
    405  
     405
    406406  printf("%s - set asr state to RTEMS_ASR - ", self.name_string());
    407407  task_mode.set_asr_state(RTEMS_ASR);
     
    410410  print_mode(mode, RTEMS_ALL_MODES);
    411411  printf("\n");
    412  
     412
    413413  printf("%s - set asr state to RTEMS_NO_ASR - ", self.name_string());
    414414  task_mode.set_asr_state(RTEMS_NO_ASR);
     
    419419
    420420  // interrupt level control
    421  
     421
    422422  rtems_interrupt_level current_level;
    423423  rtems_interrupt_level level;
     
    430430  task_mode.set_interrupt_level(102);
    431431  printf("%s\n", task_mode.last_status_string());
    432  
     432
    433433  printf("%s - set interrupt level to original level - ", self.name_string());
    434434  task_mode.set_interrupt_level(current_level, level);
     
    443443  print_mode(mode, RTEMS_ALL_MODES);
    444444  printf("\n");
    445  
    446   printf(" * END TaskMode Class test *\n"); 
     445
     446  printf(" END TaskMode Class test\n");
    447447}
    448448
    449449void Task1::screen4(void)
    450450{
    451   printf(" * START Event Class test *\n");
     451  printf(" START Event Class test\n");
    452452
    453453  printf("%s - create task 2 - ", name_string());
     
    458458  task_2.start(0);
    459459  printf("%s\n", task_2.last_status_string());
    460  
     460
    461461  printf("%s - construct event connecting to task 2 - ", name_string());
    462462  rtemsEvent event_2("TA2 ");
     
    469469  event_2.send(task_2.id_is(), RTEMS_SIGNAL_0);
    470470  printf("%s\n", event_2.last_status_string());
    471  
     471
    472472  wake_after(1000000);
    473473
     
    475475  event_2.send(task_2, RTEMS_SIGNAL_0);
    476476  printf("%s\n", event_2.last_status_string());
    477  
     477
    478478  wake_after(1000000);
    479479
     
    481481  event_2.send(RTEMS_SIGNAL_31);
    482482  printf("%s\n", event_2.last_status_string());
    483  
     483
    484484  wake_after(1000000);
    485485
     
    487487
    488488  event_2_2.connect("TA2");
    489  
     489
    490490  printf("%s - send event signal 0 and 31 - ", name_string());
    491491  event_2_2.send(task_2, RTEMS_SIGNAL_0 | RTEMS_SIGNAL_31);
    492492  printf("%s\n", event_2_2.last_status_string());
    493  
     493
    494494  printf("%s - waiting 5 secs for TA2 to finish\n", name_string());
    495495  wake_after(500000);
    496  
    497   printf(" * END Event Class test *\n"); 
     496
     497  printf(" END Event Class test\n");
    498498}
    499499
    500500void Task1::screen5(void)
    501501{
    502   printf(" * START Interrupt Class test *\n");
     502  printf(" START Interrupt Class test\n");
    503503
    504504  printf(" do not know a portable BSP type interrupt test\n");
    505505
    506   printf(" * END Interrupt Class test *\n"); 
     506  printf(" END Interrupt Class test\n");
    507507}
    508508
    509509void Task1::screen6(void)
    510510{
    511   printf(" * START MessageQueue Class test *\n");
     511  printf(" START MessageQueue Class test\n");
    512512
    513513  printf("%s - construct message queue 1 with no memory error - ", name_string());
     
    524524  size_t  size;
    525525  uint32_t count;
    526  
     526
    527527  printf("%s - send u1 to mq_2 - ", name_string());
    528528  mq_2.send(u1, strlen(u1) + 1);
    529529  printf("%s\n", mq_2.last_status_string());
    530  
     530
    531531  printf("%s - urgent send u2 to mq_2 - ", name_string());
    532532  mq_2.urgent(u2, strlen(u2) + 1);
    533533  printf("%s\n", mq_2.last_status_string());
    534  
     534
    535535  printf("%s - create task 3_1 - ", name_string());
    536536  Task3 task_3_1("TA31", 9, RTEMS_MINIMUM_STACK_SIZE * 6);
     
    540540  task_3_1.start(0);
    541541  printf("%s\n", task_3_1.last_status_string());
    542  
     542
    543543  printf("%s - create task 3_2 - ", name_string());
    544544  Task3 task_3_2("TA32", 9, RTEMS_MINIMUM_STACK_SIZE * 6);
     
    548548  task_3_2.start(0);
    549549  printf("%s\n", task_3_1.last_status_string());
    550  
     550
    551551  wake_after(1000000);
    552  
     552
    553553  printf("%s - receive u2 on mq_2 ...\n", name_string()); fflush(stdout);
    554554  mq_2.receive(in, size, 5000000);
     
    592592
    593593  wake_after(3000000);
    594  
     594
    595595  const char *b1 = "broadcast message";
    596  
     596
    597597  printf("%s - broadcast send b1 ...\n", name_string());
    598598  mq_2.broadcast(b1, strlen(b1) + 1, count);
     
    601601
    602602  wake_after(1000000);
    603  
     603
    604604  printf("%s - receive message b1 on mq_2 from %s...\n",
    605605         name_string(), task_3_1.name_string()); fflush(stdout);
     
    646646  // wait for task 3_1, and 3_2 to complete their timeout tests, will
    647647  // start these after getting the broadcast message
    648   wake_after(7000000); 
     648  wake_after(7000000);
    649649
    650650  const char *f1 = "flush message";
    651  
     651
    652652  printf("%s - send f1 to mq_2 - ", name_string());
    653653  mq_2.send(f1, strlen(f1) + 1);
    654654  printf("%s\n", mq_2.last_status_string());
    655  
     655
    656656  printf("%s - send f1 to mq_2 - ", name_string());
    657657  mq_2.send(f1, strlen(f1) + 1);
    658658  printf("%s\n", mq_2.last_status_string());
    659  
     659
    660660  printf("%s - send f1 to mq_2 - ", name_string());
    661661  mq_2.send(f1, strlen(f1) + 1);
     
    665665  mq_2.flush(count);
    666666  printf("%s, flushed=%" PRIi32 "\n", mq_2.last_status_string(), count);
    667  
    668   printf(" * END MessageQueue Class test *\n"); 
     667
     668  printf(" END MessageQueue Class test\n");
    669669}
    670670
     
    692692{
    693693}
    694  
     694
    695695void EndTask::body(rtems_task_argument)
    696696{
  • testsuites/libtests/rtems++/rtems++.scn

    re327e69 re83be28  
     1
     2
    13*** RTEMS++ TEST ***
    24INIT - Task.create() - RTEMS[19] invalid thread priority
     
    57INIT - Task.restart() - RTEMS[14] thread is in wrong state
    68INIT - Task.start(0xDEADDEAD) - RTEMS[00] successful completion
     9INIT - Destroy it's self
    710<pause - screen 1>
    8  * START Task Class test *
     11 START Task Class test
    912TA1  - test argument - argument matched
    1013TA1  - copy constructor - local and this id's match
     
    1518TA1  - connect to a local valid task name - RTEMS[00] successful completion
    1619TA1  - connect to an invalid task name - RTEMS[03] invalid object name
    17 SELF - connect to a task on an invalid node - RTEMS[21] invalid node id
     20SELF - connect to a task on an invalid node - RTEMS[03] invalid object name
    1821TA1  - restart from a non-owner - RTEMS[23] not owner of resource
    1922<pause - screen 2>
     
    5760SELF - self object get note - RTEMS[00] successful completion, notepad is 0xDEADBEEF
    5861SELF - self object set note to original value - RTEMS[00] successful completion
    59  * END Task Class test *
     62 END Task Class test
    6063<pause - screen 3>
    61  * START TaskMode Class test *
     64 START TaskMode Class test
    6265SELF - get mode - RTEMS[00] successful completion,
    63          mode is 0x00000100, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_NO_ASR INTMASK=0
     66         mode is 0x00000500, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_ASR INTMASK=0
    6467SELF - get preemption state - RTEMS[00] successful completion,
    65          mode is 0x00000100, RTEMS_NO_PREEMPT 
     68         mode is 0x00000100, RTEMS_NO_PREEMPT
    6669SELF - set preemption state to RTEMS_PREEMPT - RTEMS[00] successful completion,
    67          mode is 0x00000000, RTEMS_PREEMPT RTEMS_TIMESLICE RTEMS_NO_ASR INTMASK=0
     70         mode is 0x00000400, RTEMS_PREEMPT RTEMS_TIMESLICE RTEMS_ASR INTMASK=0
    6871SELF - set preemption state to RTEMS_NO_PREEMPT - RTEMS[00] successful completion,
    69          mode is 0x00000100, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_NO_ASR INTMASK=0
     72         mode is 0x00000500, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_ASR INTMASK=0
    7073SELF - get timeslice state - RTEMS[00] successful completion,
    71          mode is 0x00000000, RTEMS_TIMESLICE 
     74         mode is 0x00000000, RTEMS_TIMESLICE
    7275SELF - set timeslice state to RTEMS_TIMESLICE - RTEMS[00] successful completion,
    73          mode is 0x00000300, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_NO_ASR INTMASK=0
     76         mode is 0x00000700, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_ASR INTMASK=0
    7477SELF - set timeslice state to RTEMS_NO_TIMESLICE - RTEMS[00] successful completion,
    75          mode is 0x00000100, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_NO_ASR INTMASK=0
     78         mode is 0x00000500, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_ASR INTMASK=0
    7679SELF - get asr state - RTEMS[00] successful completion,
    77          mode is 0x00000000, RTEMS_NO_ASR
     80         mode is 0x00000400, RTEMS_ASR
    7881SELF - set asr state to RTEMS_ASR - RTEMS[00] successful completion,
    7982         mode is 0x00000100, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_NO_ASR INTMASK=0
     
    8285SELF - get current interrupt level - RTEMS[00] successful completion, level is 0
    8386SELF - set interrupt level to 102 - RTEMS[00] successful completion
    84 SELF - set interrupt level to original level - RTEMS[00] successful completion, level was 0
     87SELF - set interrupt level to original level - RTEMS[00] successful completion, level was 6
    8588SELF - set mode to original mode - RTEMS[00] successful completion,
    86          mode is 0x00000100, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_NO_ASR INTMASK=0
    87  * END TaskMode Class test *
     89         mode is 0x00000500, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_ASR INTMASK=0
     90 END TaskMode Class test
    8891<pause - screen 4>
    89  * START Event Class test *
     92 START Event Class test
    9093TA1  - create task 2 - RTEMS[00] successful completion
    9194TA1  - start task 2 - RTEMS[00] successful completion
     
    108111TA2  - send event signal 1 - RTEMS[00] successful completion
    109112TA2  - event wait forever for signal 1 from TA2 - RTEMS[00] successful completion, signals out are 0x00000002
    110 TA2  - destory itself
    111  * END Event Class test *
     113TA2  - destroy itself
     114 END Event Class test
    112115<pause - screen 5>
    113  * START Interrupt Class test *
     116 START Interrupt Class test
    114117 do not know a portable BSP type interrupt test
    115  * END Interrupt Class test *
     118 END Interrupt Class test
    116119<pause - screen 6>
    117  * START MessageQueue Class test *
    118 TA1  - construct message queue 1 with no memory error - RTEMS[05] too many
     120 START MessageQueue Class test
     121TA1  - construct message queue 1 with no memory error - RTEMS[13] request not satisfied
    119122TA1  - construct/create message queue 2 - RTEMS[00] successful completion
    120123TA1  - send u1 to mq_2 - RTEMS[00] successful completion
     
    144147TA31 - mq_2 receive - RTEMS[00] successful completion, size=18, message string size=17
    145148TA31 - loopback to mq_2 - RTEMS[00] successful completion
    146 TA31 - destory itself
     149TA31 - destroy itself
    147150TA32 - mq_2 receive - RTEMS[00] successful completion, size=18, message string size=17
    148151TA32 - loopback to mq_2 - RTEMS[00] successful completion
    149 TA32 - destory itself
     152TA32 - destroy itself
    150153TA1  - receive message b1 on mq_2 from TA31...
    151154TA1  - RTEMS[00] successful completion
     
    158161TA1  - send f1 to mq_2 - RTEMS[00] successful completion
    159162TA1  - flush mq_2 - RTEMS[00] successful completion, flushed=3
    160  * END MessageQueue Class test *
    161 <pause - screen 7>
     163 END MessageQueue Class test
     164*** END OF RTEMS++ TEST ***
Note: See TracChangeset for help on using the changeset viewer.