final touch on test_dashboard

This commit is contained in:
Silas Oettinghaus
2026-03-25 09:48:43 +01:00
parent b291e0a7bb
commit c6b902d346

View File

@@ -65,7 +65,7 @@ function app = test_dashboard(options)
app.TotalLabel = makeMetricLabel(headerGrid, "Total", 7);
app.FilterDropDown = uidropdown(headerGrid, ...
"Items", {'All', 'Implemented', 'Placeholder', 'Missing', 'Standalone'}, ...
"Items", {'All', 'Implemented', 'Missing', 'Standalone'}, ...
"Value", 'All', ...
"ValueChangedFcn", @filterChanged);
app.FilterDropDown.Layout.Row = 2;
@@ -176,8 +176,6 @@ function app = test_dashboard(options)
switch string(app.FilterDropDown.Value)
case "Implemented"
filtered = filtered(filtered.Status == "Implemented", :);
case "Placeholder"
filtered = filtered(filtered.Status == "Placeholder", :);
case "Missing"
filtered = filtered(filtered.Status == "Missing", :);
case "Standalone"
@@ -192,7 +190,6 @@ function app = test_dashboard(options)
function updateSummary(inventory)
implementedCount = nnz(inventory.Status == "Implemented");
placeholderCount = nnz(inventory.Status == "Placeholder");
missingCount = nnz(inventory.Status == "Missing");
passedCount = nnz(inventory.LastRun == "Passed");
failedCount = nnz(inventory.LastRun == "Failed");
@@ -200,7 +197,7 @@ function app = test_dashboard(options)
totalCount = height(inventory);
app.ImplementedLabel.Text = sprintf("Implemented: %d", implementedCount);
app.PlaceholderLabel.Text = sprintf("Placeholder: %d", placeholderCount);
app.PlaceholderLabel.Text = "Placeholder: hidden";
app.MissingLabel.Text = sprintf("Missing: %d", missingCount);
app.PassedLabel.Text = sprintf("Passed: %d", passedCount);
app.FailedLabel.Text = sprintf("Failed: %d", failedCount);
@@ -661,16 +658,16 @@ function inventory = buildInventory(repoRoot, testsRoot)
tags = "";
testFileName = "";
else
matchedTestFiles(end + 1, 1) = testFile; %#ok<AGROW>
source = fileread(testFile);
if contains(source, "assumeFail(")
status = "Placeholder";
continue
else
matchedTestFiles(end + 1, 1) = testFile; %#ok<AGROW>
status = "Implemented";
end
tags = strjoin(extractTestTags(source), ", ");
[~, testFileName] = fileparts(testFile);
end
end
targetLabel = fullfile('Classes', relativeDirText, [classNameText, '.m']);
targetLabel = strrep(targetLabel, "\", "/");
@@ -698,7 +695,7 @@ function inventory = buildInventory(repoRoot, testsRoot)
source = fileread(testFile);
if contains(source, "assumeFail(")
status = "Placeholder";
continue
else
status = "Implemented";
end
@@ -733,6 +730,8 @@ function inventory = buildInventory(repoRoot, testsRoot)
return
end
inventory = inventory(inventory.Status ~= "Placeholder", :);
statusOrder = containers.Map( ...
{'Implemented', 'Missing', 'Placeholder'}, ...
{1, 2, 3});