Difference between revisions of "Testing"

From LIBISIS
Jump to navigation Jump to search
m
 
m
Line 1: Line 1:
There are many tests contained in the matlab test folder located in
+
Tests are contained in
  
 
<pre> C:\libisis\tests\matlab_tests</pre>
 
<pre> C:\libisis\tests\matlab_tests</pre>
Line 5: Line 5:
 
==Libisis_test==
 
==Libisis_test==
  
'''libisis_test''' is a function designed to test the basics of Libisis and check that there are no critical errors it does ''NOT'' check that outputs are exactly as expected, only that they are valid (for instance, if an algorithm is mis-binning data then it will not generally be picked up). If making large changes to Libisis, this function should be used as a first check that the changes do not '' 'break' '' Libisis.  
+
'''libisis_test''' is a function designed to test the basics of Libisis and check that there are no critical errors it does ''NOT'' check that outputs are exactly as expected, only that they are valid (for instance, if an algorithm is mis-binning data then it will not generally be picked up). If making large changes to Libisis, this function should be used as a first check that the changes do not '' 'break' '' Libisis. The test takes around 5 minutes.  
  
This test can be run with several different options from the Matlab command line. Several options may be given at the same time using the syntax
+
This test can be run with several different options from the Matlab command line. Several options may be given at the same time using the syntax.
  
 +
 
 
   >> libisis_test(option1, option2, option3, ...)
 
   >> libisis_test(option1, option2, option3, ...)
 
   
 
   
Line 38: Line 39:
 
| only test the graphics package part of libisis
 
| only test the graphics package part of libisis
 
|}
 
|}
 +
 +
 +
===Adding New Tests===
 +
 +
To add new tests, look at gtk_test_script and libisis_test_script. These two functions contain all of the tests. Note that a series of flags are set by the optional inputs, see these in the libisis_test.m file. Use the data from these in conditional statements. For instance, if the check requires user interaction, then use a statement like
 +
 +
  if ~continuous_flag
 +
    toby_interp(w1)
 +
  end

Revision as of 14:26, 5 August 2008

Tests are contained in

 C:\libisis\tests\matlab_tests

Libisis_test

libisis_test is a function designed to test the basics of Libisis and check that there are no critical errors it does NOT check that outputs are exactly as expected, only that they are valid (for instance, if an algorithm is mis-binning data then it will not generally be picked up). If making large changes to Libisis, this function should be used as a first check that the changes do not 'break' Libisis. The test takes around 5 minutes.

This test can be run with several different options from the Matlab command line. Several options may be given at the same time using the syntax.


 >> libisis_test(option1, option2, option3, ...)

Option Description
'lite' data is rebinned so that datasets are smaller, fewer plots are made. The test performs quicker and on slower machines but is less rigorous.
'full' currently the same as running without any options
'extra only' runs the series of 'extra' tests only. These are tests that have been added recently, so a full test is not performed but new functions are tested.
'detailed' The test will stop at regular intervals so that variables and plots can be inspected.
'continuous' Some of the tests require user interaction, these will be skipped if continuous is used
'libisis only' only test the data manipulation part of libisis
'gtk only' only test the graphics package part of libisis


Adding New Tests

To add new tests, look at gtk_test_script and libisis_test_script. These two functions contain all of the tests. Note that a series of flags are set by the optional inputs, see these in the libisis_test.m file. Use the data from these in conditional statements. For instance, if the check requires user interaction, then use a statement like

 if ~continuous_flag
   toby_interp(w1)
 end