source: rtems/testsuites/sptests/sp07/task1.c @ a6879a4

5
Last change on this file since a6879a4 was a6879a4, checked in by Sebastian Huber <sebastian.huber@…>, on 12/02/19 at 07:14:34

testsuites: Remove rtems_test_pause*()

The rtems_test_pause() and rtems_test_pause_and_screen_number() macros
had different implementations depending on the RTEMS_TEST_NO_PAUSE
define. This define was defined to 1 by default. The user was able to
change this via the undocumented --disable-test-no-pause configure
command line option.

Pausing tests and waiting for user input contradicts the goal of having
automated test runs. Remove this feature.

Update #3818.

  • Property mode set to 100644
File size: 1.7 KB
Line 
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.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include "system.h"
15
16rtems_task Task_1(
17  rtems_task_argument argument
18)
19{
20  rtems_status_code   status;
21  rtems_task_priority the_priority;
22  rtems_task_priority previous_priority;
23
24  status = rtems_task_set_priority(
25    RTEMS_SELF,
26    RTEMS_CURRENT_PRIORITY,
27    &the_priority
28  );
29  directive_failed( status, "rtems_task_set_priority" );
30  printf(
31    "TA1 - rtems_task_set_priority - get initial "
32       "priority of self: %02" PRIdrtems_task_priority "\n",
33    the_priority
34  );
35
36  while( FOREVER ) {
37    if ( --the_priority == 0 ) {
38      puts( "TA1 - rtems_task_suspend - suspend TA2" );
39      status = rtems_task_suspend( Task_id[ 2 ] );
40      directive_failed( status, "rtems_task_suspend" );
41
42      puts( "TA1 - rtems_task_set_priority - set priority of TA2 ( blocked )" );
43      status = rtems_task_set_priority( Task_id[ 2 ], 5, &previous_priority );
44      directive_failed( status, "rtems_task_set_priority" );
45
46      status = rtems_task_delete( Task_id[ 2 ] );
47      directive_failed( status, "rtems_task_delete of TA2" );
48
49      rtems_task_exit();
50    }
51
52    printf(
53      "TA1 - rtems_task_set_priority - set TA2's priority: "
54          "%02" PRIdrtems_task_priority "\n",
55      the_priority
56    );
57    status = rtems_task_set_priority(
58               Task_id[ 2 ],
59               the_priority,
60               &previous_priority
61    );
62    directive_failed( status, "rtems_task_set_priority" );
63  }
64}
Note: See TracBrowser for help on using the repository browser.