Skip to content
Snippets Groups Projects
Commit 54f5cdf4 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

ENH: Better test output formatting.

parent 0a7ddac9
No related branches found
No related tags found
No related merge requests found
Pipeline #18814 canceled
...@@ -18,11 +18,45 @@ ...@@ -18,11 +18,45 @@
pkg load caosdb; pkg load caosdb;
all_tests = true; tests = struct("name", {"test_query_retrieve.m", ...
all_tests &= moxunit_runtests("-verbose", "test_query_retrieve.m"); "test_transaction.m", ...
all_tests &= moxunit_runtests("-verbose", "test_transaction.m"); "test_files.m"} ...
all_tests &= moxunit_runtests("-verbose", "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); exit(1);
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment