diff --git a/test/Run_Test.m b/test/Run_Test.m index 340a7fce5db790f3670faa6ef87a3dc855083290..de455738a6aefb241cc34a3baeccb56766b7461b 100644 --- a/test/Run_Test.m +++ b/test/Run_Test.m @@ -18,11 +18,45 @@ pkg load caosdb; -all_tests = true; -all_tests &= moxunit_runtests("-verbose", "test_query_retrieve.m"); -all_tests &= moxunit_runtests("-verbose", "test_transaction.m"); -all_tests &= moxunit_runtests("-verbose", "test_files.m"); +tests = struct("name", {"test_query_retrieve.m", ... + "test_transaction.m", ... + "test_files.m"} ... + ); -if not(all_tests) +for i = [1:numel(tests)] + result = moxunit_runtests("-verbose", tests(i).name); + tests(i).result = result; +end +result_all = all([tests.result]); + +max_width = max(cellfun(@numel, {tests.name})) + 2; +max_width -= mod(max_width, -4); % round to next largest multiple of 4. + +disp("\n===========================\n"); +disp("Result of integration tests"); +disp("===========================\n"); +for i = [1:numel(tests)] + result_str = "FAIL"; + if tests(i).result + result_str = "PASS"; + end + disp(sprintf(["%-" num2str(max_width) "s %s"], tests(i).name, result_str)); +end +disp(repmat("-", [1, max_width + 4 + numel(result_str)])); + +passes = sum([tests.result]); +fails = sum(~[tests.result]); +passes_str = sprintf("%d passed", passes); +fails_str = sprintf("%d failed", fails); + +result_str = "FAIL"; +if result_all > 0 + result_str = "PASS"; +end + +result_str = sprintf("%s (%s, %s)", result_str, passes_str, fails_str); +disp(result_str); + +if not(result_all) exit(1); end