% -*- texinfo -*- % @deftypefn {Function File} {} test @var{name} % @deftypefnx {Function File} {} test @var{name} quiet|normal|verbose % @deftypefnx {Function File} {} test ('@var{name}', 'quiet|normal|verbose', @var{fid}) % @deftypefnx {Function File} {} test ([], 'explain', @var{fid}) % @deftypefnx {Function File} {@var{success} =} test (@dots{}) % @deftypefnx {Function File} {[@var{n}, @var{max}] =} test (@dots{}) % @deftypefnx {Function File} {[@var{code}, @var{idx}] =} test ('@var{name}','grabdemo') % % Perform tests from the first file in the loadpath matching @var{name}. % @code{test} can be called as a command or as a function. Called with % a single argument @var{name}, the tests are run interactively and stop % after the first error is encountered. % % With a second argument the tests which are performed and the amount of % output is selected. % % @table @asis % @item 'quiet' % Don't report all the tests as they happen, just the errors. % % @item 'normal' % Report all tests as they happen, but don't do tests which require % user interaction. % % @item 'verbose' % Do tests which require user interaction. % @end table % % The argument @var{fid} can be used to allow batch processing. Errors % can be written to the already open file defined by @var{fid}, and % hopefully when Octave crashes this file will tell you what was happening % when it did. You can use @code{stdout} if you want to see the results as % they happen. You can also give a file name rather than an @var{fid}, in % which case the contents of the file will be replaced with the log from % the current test. % % Called with a single output argument @var{success}, @code{test} returns % true if all of the tests were successful. Called with two output arguments % @var{n} and @var{max}, the number of successful tests and the total number % of tests in the file @var{name} are returned. % % If the second argument is the string 'grabdemo', the contents of the demo % blocks are extracted but not executed. Code for all code blocks is % concatenated and returned as @var{code} with @var{idx} being a vector of % positions of the ends of the demo blocks. % % If the second argument is 'explain', then @var{name} is ignored and an % explanation of the line markers used is written to the file @var{fid}. % @seealso{error, assert, fail, demo, example} % @end deftypefn