0001 function t_end
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 global t_quiet;
0027 global t_num_of_tests;
0028 global t_counter;
0029 global t_ok_cnt;
0030 global t_not_ok_cnt;
0031 global t_skip_cnt;
0032 global t_clock;
0033
0034 t_counter = t_counter - 1;
0035
0036 if t_counter == t_num_of_tests && ...
0037 t_counter == t_ok_cnt + t_skip_cnt && ...
0038 t_not_ok_cnt == 0
0039 all_ok = 1;
0040 else
0041 all_ok = 0;
0042 end
0043
0044 if t_quiet
0045 if all_ok
0046 fprintf('ok');
0047 if t_skip_cnt
0048 fprintf(' (%d of %d skipped)', t_skip_cnt, t_num_of_tests);
0049 end
0050 else
0051 fprintf('not ok\n');
0052 fprintf('\t##### Ran %d of %d tests: %d passed, %d failed', ...
0053 t_counter, t_num_of_tests, t_ok_cnt, t_not_ok_cnt);
0054 if t_skip_cnt
0055 fprintf(', %d skipped', t_skip_cnt);
0056 end
0057 end
0058 fprintf('\n');
0059 else
0060 if all_ok
0061 if t_skip_cnt
0062 fprintf('All tests successful (%d passed, %d skipped of %d)', ...
0063 t_ok_cnt, t_skip_cnt, t_num_of_tests);
0064 else
0065 fprintf('All tests successful (%d of %d)', t_ok_cnt, t_num_of_tests);
0066 end
0067 else
0068 fprintf('Ran %d of %d tests: %d passed, %d failed', ...
0069 t_counter, t_num_of_tests, t_ok_cnt, t_not_ok_cnt);
0070 if t_skip_cnt
0071 fprintf(', %d skipped', t_skip_cnt);
0072 end
0073 end
0074 fprintf('\nElapsed time %.2f seconds.\n', etime(clock, t_clock));
0075 end