From f232366c34a718cde40d20c19759826280220e9e Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 25 Mar 2013 16:26:34 -0400 Subject: [PATCH] Take an optional integer parameter to ./run-tests.m to loop more than once. --- run-tests.m | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/run-tests.m b/run-tests.m index 0bf037f..001e740 100755 --- a/run-tests.m +++ b/run-tests.m @@ -1,7 +1,9 @@ #!/usr/bin/octave --silent # # You'll need to use the .octaverc in this directory to get the proper -# paths. +# paths. You can pass it an integer on the command-line to specify how +# many times we should run the test suite in succession. The default +# is 1. # addpath('./unit_test'); @@ -12,8 +14,17 @@ unit_init(1, {}); test_files = glob('tests/*.m'); +loop_count = 1; +arg_list = argv(); +if (length(arg_list) > 0) + loop_count = arg_list{1}; +end + ## Source every file that matches the glob above. -cellfun(@source, test_files); +for idx = [ 1 : loop_count ] + cellfun(@source, test_files); +end + fprintf('\n'); fprintf('Total tests attempted: %d\n', unittest_results.total); -- 2.44.2