X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=unit_init.m;fp=unit_init.m;h=0000000000000000000000000000000000000000;hb=ef3085ef3c40eab925219bad1c6dbb2c6e106727;hp=b692a80b8827096576728ee3de0be5773ab7c9a3;hpb=33e4dd7a64f35fb22774d59af11f5670ab566fbc;p=octave.git diff --git a/unit_init.m b/unit_init.m deleted file mode 100644 index b692a80..0000000 --- a/unit_init.m +++ /dev/null @@ -1,41 +0,0 @@ -function unit_init(verbosity, global_vars) - ## Initialize the global structure unittest_results, which is needed - ## in all functions of the *unittest module. Debugging information - ## is printed if verbosity==1. global_vars is a cell array of the - ## names of the global variables used in the tests. - ## - ## e.g. unit_init(1, {"g", "a", "x"}) - - global unittest_results; - - unittest_results.verbose = 0; - unittest_results.eval_globals = {}; - if (nargin > 0) - if (!isscalar(verbosity) || verbosity < 0 || verbosity > 1) - warning("unit_init: verbose must be 0 or 1"); - else - unittest_results.verbose = verbosity; - endif - - if (nargin == 2 && iscell(global_vars)) - for i = 1:length(global_vars) - unittest_results.eval_globals{i} = strcat("global ", global_vars{i}, ";"); - endfor - else - error("global_vars must be a cell array"); - endif - - if (nargin > 2) - usage("expecting 2 arguments only"); - end - endif - - unittest_results.total = 0; # number of testcases attempted - unittest_results.pass = 0; # number of expected passed - unittest_results.fail = 0; # number of unexpected failures - unittest_results.upass = 0; # number of unexpected passes - unittest_results.xfail = 0; # number of expected failures - unittest_results.unresolved = 0; # number of unresolved testcases - - default_eval_print_flag = 0; -endfunction