Home > matpower7.1 > mptest > lib > t_skip.m

t_skip

PURPOSE ^

T_SKIP Skips a number of tests.

SYNOPSIS ^

function t_skip(cnt, msg)

DESCRIPTION ^

T_SKIP  Skips a number of tests.
   T_SKIP(CNT, MSG) increments the global test count and skipped tests
   count. Prints 'skipped x..y : ' followed by the MSG, unless
   T_BEGIN was called with input QUIET equal true. Intended to be
   called between calls to T_BEGIN and T_END.

   Example:
       quiet = 0;
       t_begin(5, quiet);
       t_ok(pi > 3, 'size of pi');
       t_skip(3, 'not yet written');
       t_is(2+2, 4, 12, '2+2 still equals 4');
       t_end;

   See also T_OK, T_IS, T_BEGIN, T_END, T_RUN_TESTS.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function t_skip(cnt, msg)
0002 %T_SKIP  Skips a number of tests.
0003 %   T_SKIP(CNT, MSG) increments the global test count and skipped tests
0004 %   count. Prints 'skipped x..y : ' followed by the MSG, unless
0005 %   T_BEGIN was called with input QUIET equal true. Intended to be
0006 %   called between calls to T_BEGIN and T_END.
0007 %
0008 %   Example:
0009 %       quiet = 0;
0010 %       t_begin(5, quiet);
0011 %       t_ok(pi > 3, 'size of pi');
0012 %       t_skip(3, 'not yet written');
0013 %       t_is(2+2, 4, 12, '2+2 still equals 4');
0014 %       t_end;
0015 %
0016 %   See also T_OK, T_IS, T_BEGIN, T_END, T_RUN_TESTS.
0017 
0018 
0019 %   MP-Test
0020 %   Copyright (c) 2004-2020, Power Systems Engineering Research Center (PSERC)
0021 %   by Ray Zimmerman, PSERC Cornell
0022 %
0023 %   This file is part of MP-Test.
0024 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0025 %   See https://github.com/MATPOWER/mptest for more info.
0026 
0027 global t_quiet;
0028 global t_counter;
0029 global t_skip_cnt;
0030 
0031 if nargin < 2 || strcmp(msg, '')
0032     msg = '';
0033 else
0034     msg = [' - ', msg];
0035 end
0036 
0037 t_skip_cnt = t_skip_cnt + cnt;
0038 if ~t_quiet
0039     if cnt == 1
0040         fprintf('skipped %d%s\n', t_counter, msg);
0041     else
0042         fprintf('skipped %d..%d%s\n', t_counter, t_counter+cnt-1, msg);
0043     end
0044 end
0045 t_counter = t_counter + cnt;

Generated on Fri 09-Oct-2020 11:21:31 by m2html © 2005