-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildfile.m
More file actions
89 lines (78 loc) · 3.13 KB
/
Copy pathbuildfile.m
File metadata and controls
89 lines (78 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
function plan = buildfile
%BUILDFILE Stable LabKit validation and documentation entry points.
% buildtool changedFast local semantic pre-commit evidence
% buildtool headless every headless specification
% buildtool gui every hidden-GUI specification
% buildtool isolated every path-isolated specification
% buildtool coverage headless specifications with coverage artifacts
% buildtool docs render documentation
% buildtool docsCheck verify generated documentation
plan = buildplan(localfunctions);
plan.DefaultTasks = "headless";
plan("changedFast").Description = "Run focused pre-commit specifications selected from the local diff";
plan("headless").Description = "Run all non-GUI product, SDK, persistence, and export specifications";
plan("gui").Description = "Run hidden native-App, callback, graphics, and export workflows";
plan("isolated").Description = "Start every public App from a reset path to detect undeclared dependencies";
plan("coverage").Description = "Run headless specifications and publish source coverage artifacts";
plan("docs").Description = "Regenerate the path-owned documentation site";
plan("docsCheck").Description = "Verify generated documentation matches its source contracts";
plan("listTasks").Description = "List the stable LabKit build entry points";
end
function changedFastTask(~)
runTests("changed");
end
function headlessTask(~)
runTests("headless");
end
function guiTask(~)
runTests("gui");
end
function isolatedTask(~)
runTests("isolated");
end
function coverageTask(~)
runTests("coverage", Coverage=true);
end
function docsTask(~)
runDocumentationTask(false);
end
function docsCheckTask(~)
runDocumentationTask(true);
end
function listTasksTask(~)
fprintf("LabKit build tasks:\n");
fprintf(" changedFast local semantic pre-commit evidence\n");
fprintf(" headless every headless specification\n");
fprintf(" gui every hidden-GUI specification\n");
fprintf(" isolated every path-isolated specification\n");
fprintf(" coverage headless specifications with coverage artifacts\n");
fprintf(" docs render documentation\n");
fprintf(" docsCheck verify generated documentation\n");
end
function runTests(profile, options)
arguments
profile (1,1) string
options.Coverage (1,1) logical = false
end
root = fileparts(mfilename("fullpath"));
addpath(fullfile(root, "tests"));
labkittest.run(Profile=profile, RunName=profile, ...
ArtifactsRoot=fullfile(root, "artifacts", "test-results"), ...
Coverage=options.Coverage);
end
function runDocumentationTask(checkOnly)
root = fileparts(mfilename("fullpath"));
toolFolder = fullfile(root, "tools", "docs");
addpath(toolFolder);
cleanup = onCleanup(@() rmpath(toolFolder));
if checkOnly
result = checkLabKitDocs(fullfile(root, "docs"));
fprintf("LabKit documentation is deterministic: %d generated file(s).\n", ...
result.comparedFileCount);
else
result = renderLabKitDocs(fullfile(root, "docs"), fullfile(root, "site"));
fprintf("Generated %d narrative page(s) and %d API reference page(s) in %s.\n", ...
result.pageCount, result.apiCount, result.outputRoot);
end
clear cleanup
end