# stop

> 0. Terminating execution

> 1. Stopping components

> 2. Stopping ports

> 3. Stopping timers

> 4. Stopping the profiler

### 0. Terminating execution

The stop statement is used to terminate test execution. Whenever a stop statement is reached, the execution of the underlying testcase is immediately terminatef. The result of execution will be error.

### stop;

Examples:

### 1. Stopping components

- When used in a test case, altstep or function that are executed on a test component, the keyword terminates the relevant test component;
- when used in the control part of a module or in a function used by the control part of a module, it terminates the execution of the module control part.
- When prefixed with a component reference, other than the own component will be stopped;
- when prefixed with the all component keyword pair, all components except the main test component will be stopped.

Related keywords:

- all
- component
- create
- @profiler

### [ component_reference.] stop;

- The optional component_reference (used when other than the own component should be stopped) is one of the following:

  - a reference returned by the create operation to refer to a given component,
  - the keyword pair all component when referring to all parallel test components (the command must be issued in the main test component),
  - the keyword self when referring to the own component,
  - the keyword mtc when referring to the main test component.

- The stop keyword denotes that (a) component(s) should be stopped.

See Examples

### 2. Stopping a port

The keyword may be used to stop a port.

- The operation causes listening at the named ports to cease and disallows the sending operations.
- The port may be restarted by a subsequent start operation.
- It is possible to stop all defined ports.

Related keywords:

- all
- port

### port_reference.stop;

- port_reference points out the port to be stopped.

  - the keywords all port may be used to indicate that all defined ports must be stopped (see the example 2b).

- The stop keyword introduces port stopping.

### 3. Stopping timers

The keyword may be used to indicate that a timer should stop running.

- The keyword all may be used to stop all timers that are visible in the scope unit in which the operation has been called.
- Stopping an inactive timer is a valid operation, although it does not have any effect.
- Stopping an expired timer causes the entry for this timer in the timeout-list to be removed.

Related keywords:

- all
- read
- running
- timer
- start
- timeout

### ( timer_identifier | all timer ).stop ;

- timer_identifier is the name used to refer to the timer. It must begin with a letter, may contain letters, numbers and underscore characters.

It is possible to stop a member of an timer array.

### timer_identifier[array_index].stop;

- timer_identifier is the name used to refer to the timer. It must begin with a letter, may contain letters, numbers and underscore characters.

- array_index points out the timer to be stopped.

Examples

Example 1a:

self.stop;

The own test component is terminated. (The command was issued in a test case, altstep or function that are executed on a test component).

Example 1b:

stop;

The test case execution is interrupted.

Example 1c:

vc_Hivatkozaas.stop;

The component with the reference vc_Hivatkozaas is stopped.

Example 1d:

all component.stop;

All test components except the main test controller are stopped.

Example 1e:

self.stop;

The own test component is stopped. It has the same effect as in example 1a

Example 1f:

mtc.stop;

The main test component is stopped.

Example 2a:

Kapu_PCO.stop;

The port Kapu_PCO will be stopped.

Example 2b:

all port.stop;

All ports will be stopped.

Example 3a:

T_soek.stop;

The global timer T_soek is stopped provided that it was running, otherwise the command has no effect.

Example 3b:

all timer.stop;

The local timer Tl_foerlorad is declared (1st line) and stoped with a duration of 20 ms (2nd line).

Example 3c:

timer Tl_Denfert[2] := {-, 1E-1, -};
Tl_Denfert[1].stop(20E-3);

The array of local timers declared is called Tl_denfert and consists of three timers . The second timer has the default value of 100 ms, the others have no default value(1st line). The second timer in the array is stoped for 20 ms, overwriting the default value of 100 ms (2nd line).

BNF definition of component stop

BNF definition of timer stop