Test Script

From STRIDE Wiki
Revision as of 20:46, 6 July 2015 by Marku (talk | contribs) (→‎Running a Test Script)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Stride's test script solution allows users to take advantage of the power of dynamic languages on the host to execute test scenarios on the device under test. Some of the advantages of host based script tests are:

  • test coverage can be expanded without any changes to the target device.
  • sophisticated device automation possible using facilities available on the host.
  • no additional code space requirements on the device once the software under test.
  • powerful data validation techniques are possible using the power of the host (validating large media files generated by the target device, for example).
  • large library of extension modules are available for standard dynamic languages (e.g. cpan for perl)


Example Test Script (i.e. MyTest.pm)

use strict;
use warnings;

package MyTests;
use base qw(STRIDE::Test);
use STRIDE::Test;

sub test_one : Test
{
    ASSERT_TRUE(1);
}

sub test_two : Test
{
    ASSERT_TRUE(0);
}

1;

Running a Test Script

Stride executes tests using a runner controlled by a host computer. Refer to Running Tests for Test Units.

Invoking the Runner (aka stride) from a console

 stride ..  --run=MyTest.pm