Selftest plugin

Aus expecco Wiki (Version 25.x)
Version vom 21. April 2018, 08:06 Uhr von Cg (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „The plugin runs selftest scripts on acitions of a library. Each action has associated to it a test script which specifies the inputs and expected behavior of t…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

The plugin runs selftest scripts on acitions of a library. Each action has associated to it a test script which specifies the inputs and expected behavior of the action. The script's syntax is very simple and scripts can easily be created from a requirements or certification document.

Its main use is as input for a certification suite of expecco's standard library.

Script Syntax

The script consists of individual commands, each containing a textual command. Currently, there are 5 different commands:

  • "in ..."
    specifies the input value(s) to be given to the action
  • "out" ..."
    specifies the expected output value(s)
  • "run" ..."
    runs the test setup (given by previous in & out commands) and verifies the outcome
  • "prerequisite" ...
    a prerequistite for the action, to be executed before the test run
  • "cleanup" ...
    a cleanup action to be executed after the test run

"in" Command

Specifies input values as Smalltalk expressions separated by a period ("."). For unconnected inputs, individual expressions can be left empty. For example:

  • in 1 . 2 . 3
    Provides 3 integer input values to the first 3 input pins, with values "1", "2" and "3" respecitvely.
  • in 1 . . 'abc'
    Provides the integer "1" to the first input pin, no values to the second and third input pin, and the string "abc" to the fourth input pin.
  • in
    no input values are provided

"out" Command

Similar to the above "in" command, this defines the expected output values. For pins where no output is expected, empty expressions must be given.

"run" Command

"prerequisites" Command

Defines a Smalltalk expression to be evaluated BEFORE the test run is executed. A typical use is the creation of a temporary file (eg. when testing the "File [exists]" action block.


"cleanup" Command

Defines a Smalltalk expression to be evaluated AFTER the test run is executed. A typical use is the deletion of a temporary file (eg. when testing the "File [exists]" action block.


Sample Script

The following sample script could used with the "Arith [ Sum ]" action: in # no inputs out # no outputs expected run error # expect an error (no inputs given)

in 1 . 2 # two inputs given out 3 # expected output run # no error expected



Copyright © 2014-2024 eXept Software AG