NodeBrain User Guide
Release 0.6.4 - April 2006

< Prev Table of Contents Next >

2         Check Scripts

 

A feature for testing nb called a "check script" is used for regression testing new releases and verifying builds, ports and installs.  You may also find this feature useful for regression testing custom skill modules.  One first builds a script to test a set of features.  The "show" command is used as necessary to make sure internal results are as expected.  Then the test script is run in check mode to create a check script by prefixing the file name with "~".

 

        nb ~<name>.nb

 

The generated check script is named "<name>.nb~". This script is a copy of the one executed, but with "check lines" included.  A check line is identified by a "~" in column 1. The check operation is specified in column 2.

 

        ' '  - Match column 3 to end of line with a line of output.

              e.g. "~ text to match goes here"

        '^' - Reset the check buffer as if we matched everything.

              e.g. "~^ "

        '#' - Check comment---no operation

              e.g. "~# Checking to make sure ..."

 

A check script is run in check mode to make sure we get identical results (based on output) later.

 

        nb -b ~<name>.nb~

 

The bail option "-b" in check mode will only bail out on the first check error, not on a normal error.  So a check script can verify that normal error messages are produced.

 

A check line is "hidden" when a check script is run in normal mode, and displays when running in check mode.

 

If you write custom expert skill modules, experiment with this feature as a simple method of performing regression tests.  Check out the samples provided in the check directory of a NodeBrain distribution.

 

 


Copyright © 2003-2006 The Boeing Company