t_begin

t_begin(num_of_tests, quiet)

t_begin() - Begin running tests.

t_begin(num_of_tests)
t_begin(num_of_tests, quiet)

Initializes the global test counters, setting everything up to execute num_of_tests tests using the individual test functions t_ok(), t_is(), t_file_match(), t_str_match() and t_skip(). If quiet is true, it will not print anything for the individual tests, only a summary when t_end() is called.

Inputs:
  • num_of_tests (integer) – number of tests expected

  • quiet (boolean) – (optional, default = false) if true, prevents printing individual tests results

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_end(), t_ok(), t_is(), t_str_match(), t_file_match(), t_skip(), t_run_tests().