Skip to content

Commit bd4c1a4

Browse files
committed
Make and tests polished & packages updated
1 parent 3b72f75 commit bd4c1a4

File tree

9 files changed

+165
-29
lines changed

9 files changed

+165
-29
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ aplcore
22
CONTINUE.dws
33
conga.crash
44
/packages_dev/*
5+
/Dist/
6+
/packages/*
7+
!/packages/apl-dependencies.txt
8+
!/packages/apl-buildlist.json
9+
/packages_dev/*
510
!/packages_dev/apl-dependencies.txt
611
!/packages_dev/apl-buildlist.json
7-
/Dist/
8-
/TestResults/

APLSource/Admin/Make.aplf

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
Make flag
1+
Make flag;M;C;path;zipFilename;res;version;cfg;parms
2+
⍝ "Make" a new version of this project
23
:If flag
3-
⎕SE.MakeHelpers.CreateTatinPackageFromSingleScript ##.EventCodes
4+
M←⎕SE.MakeHelpers
5+
C←##.CiderConfig
6+
path←C.HOME,'/',C.CIDER.distributionFolder
7+
cfg←⎕JSON⍠('Dialect' 'JSON5')⊢⊃⎕NGET C.HOME,'/apl-package.json'
8+
version←M.CompileVersionNumberPattern cfg
9+
M.RecreateFolder path
10+
parms←⎕SE.Tatin.CreateBuildParms C.HOME
11+
parms.targetPath←path
12+
parms.version←version
13+
zipFilename←⎕SE.Tatin.BuildPackage parms
14+
⎕←'*** New version build successfully:',M.CR,' ',zipFilename
415
:EndIf
16+
⍝Done

APLSource/TestCases/Prepare.aplf

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
1-
Prepare;testPath;testFilename;ask;answer
1+
Prepare;testPath;testFilename;ask;answer;options;flag;ind
2+
⍝ Creates an instance of the class `Tester2` named `T` and configures it for
3+
⍝ Assumes that the project is handled by the project manager "Cider", and that there is
4+
⍝ a namespace ##.CiderConfig available with the Cider config parameters.
5+
⍝ As a side effect is creates a folder "TestResults" in the project's root folder if the
6+
⍝ user wants to do code coverage with the `CodeCoverage` class.
27
⎕IO←1 ⋄ ⎕ML←1
38
T←⎕NEW Tester2 ⎕THIS
4-
T.custom_1←'Not ready yet'
5-
testPath←(⊃1 ⎕NPARTS''),'TestResults'
9+
testPath←##.CiderConfig.HOME,'/TestResults'
610
testFilename←testPath,'/CodeCoverage'
11+
flag←0
712
:If ⎕NEXISTS testPath
8-
:If ⎕NEXISTS testFilename,'.dcf'
9-
ask←{⎕←⍵,'; 1=append, 2=replace' ⋄ a←⎕ ⋄ ~(⊂a)∊1 2:∇ ⍵ ⋄ ⊃a}
10-
answer←⊃ask'Coverage file already exists'
11-
:If 2≡answer
12-
1 ⎕NDELETE testFilename,'.dcf'
13+
:If ⎕NEXISTS testFilename,'.profile'
14+
ind←('Code Coverage' 0 1)CommTools.Select'Append' 'Replace' 'Neither'
15+
→(3=ind)/0
16+
flag←1
17+
:If 2=ind
18+
1 CodeCoverage.DeleteFiles testFilename
1319
:EndIf
20+
:Else
21+
flag←0 CommTools.YesOrNo'Code coverage?'
1422
:EndIf
23+
:Else
24+
flag←0 CommTools.YesOrNo'Code coverage?'
25+
:EndIf
26+
:If flag
27+
3 ⎕MKDIR testPath ⍝
28+
T.codeCoverage←⎕NEW CodeCoverage(,⊂'#.',{⍵,'.',⍵}2↓⍕⎕THIS.##)
29+
T.codeCoverage.filename←testFilename
1530
:EndIf
16-
3 ⎕MKDIR testPath ⍝
17-
T.codeCoverage←⎕NEW CodeCoverage(,⊂'#.',{⍵,'.',⍵}2↓⍕⎕THIS.##)
18-
T.codeCoverage.filename←testFilename
19-
⍝Done

APLSource/TestCases/RunTests.aplf

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
RunTests;htmlFilename
1+
RunTests;htmlFilename;verbose;option
2+
⍝ 1. Prepares the test framework
3+
⍝ 2. Runs all test cases
4+
⍝ 3. Processes the code coverage data (if collected)
5+
⍝ 4. Asks the user whether the code coverage report should be put on view
26
Prepare
37
T.Run 1
4-
htmlFilename←CodeCoverage.ProcessDataAndCreateReport T.codeCoverage.filename
5-
:If 0 ∆YesOrNo'View CodeCoverage report?'
6-
APLTreeUtils2.GoToWebPage'file://',htmlFilename
8+
:If 0<≢T.codeCoverage
9+
{}CodeCoverage.ProcessData T.codeCoverage.filename
10+
option←'Type of code coverage report' 0 1 CommTools.Select'Overview' 'Verbose' 'None'
11+
:If 3>option
12+
verbose←2=option
13+
htmlFilename←verbose CodeCoverage.CreateReport T.codeCoverage.filename
14+
⎕←']Open file://',htmlFilename
15+
:EndIf
716
:EndIf
8-
⍝Done
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(success log)←RunTestsInBatchMode;rc
2+
⍝ Runs all test with the batch flag on and the debug flag off.
3+
⍝ Returns a two-item vector:\\
4+
⍝ [1] Boolean with 1 indicating success and 0 failure\\
5+
⍝ [2] A vector of character vectors with the messages
6+
Prepare
7+
(rc log)←T.RunBatchTests 0
8+
success←rc=0

apl-package.json

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
{ api: "EventCodes", assets: "", date: "2021-03-02", description: "Constants with meaningful names for Dyalog error codes", group: "aplteam", info_url: "https://github.com/aplteam/EventCodes", io: 1, ml: 1, name: "EventCodes", source: "EventCodes.aplc", tags: "aplteam,event-constants,windows,linux,mac-os;dyalog-apl", version: "3.0.1+25", wx: 3,}
1+
{
2+
api: "EventCodes",
3+
assets: "",
4+
description: "Constants with meaningful names for Dyalog error codes",
5+
documentation: "",
6+
files: "",
7+
group: "aplteam",
8+
io: 1,
9+
license: "MIT",
10+
lx: "",
11+
maintainer: "kai@aplteam.com",
12+
minimumAplVersion: "18.0",
13+
ml: 1,
14+
name: "EventCodes",
15+
os_lin: 0,
16+
os_mac: 0,
17+
os_win: 1,
18+
project_url: "https://github.com/aplteam/EventCodes",
19+
source: "APLSource/EventCodes.aplc",
20+
tags: "event-constants",
21+
userCommandScript: "",
22+
version: "3.0.1+27",
23+
}

cider.config

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,72 @@
1-
{ CIDER: { githubUsername: "aplteam", info_url: "https://github.com/aplteam/EventCodes", init: "", make: "Admin.Make 1", parent: "#", projectSpace: "EventCodes", source: "APLSource", tatinFolder: "packages_dev=TestCases", tests: "TestCases.RunTests", }, LINK: { arrays: 0, beforeRead: "", beforeWrite: "", caseCode: 0, codeExtensions: [ "aplf", "aplo", "apln", "aplc", "apli", "dyalog", "apl", "mipage", ], fastLoad: 0, flatten: 0, forceExtensions: 0, forceFilenames: 1, getFilename: "", typeExtensions: [ [ 2, "apla", ], [ 3, "aplf", ], [ 4, "aplo", ], [ 9.1, "apln", ], [ 9.4, "aplc", ], [ 9.5, "apli", ], ], watch: "ns", }, SYSVARS: { io: 1, ml: 1, }, USER: { },}
1+
{
2+
CIDER: {
3+
dependencies: {
4+
tatin: "",
5+
},
6+
dependencies_dev: {
7+
tatin: "packages_dev=TestCases",
8+
},
9+
distributionFolder: "Dist",
10+
init: "",
11+
make: "Admin.Make 1",
12+
parent: "#",
13+
projectSpace: "EventCodes",
14+
project_url: "https://github.com/aplteam/EventCodes",
15+
source: "APLSource",
16+
tests: "TestCases.RunTests",
17+
},
18+
LINK: {
19+
arrays: 0,
20+
beforeRead: "",
21+
beforeWrite: "",
22+
caseCode: 0,
23+
codeExtensions: [
24+
"aplf",
25+
"aplo",
26+
"apln",
27+
"aplc",
28+
"apli",
29+
"dyalog",
30+
"apl",
31+
"mipage",
32+
],
33+
fastLoad: 0,
34+
flatten: 0,
35+
forceExtensions: 0,
36+
forceFilenames: 1,
37+
getFilename: "",
38+
typeExtensions: [
39+
[
40+
2,
41+
"apla",
42+
],
43+
[
44+
3,
45+
"aplf",
46+
],
47+
[
48+
4,
49+
"aplo",
50+
],
51+
[
52+
9.1,
53+
"apln",
54+
],
55+
[
56+
9.4,
57+
"aplc",
58+
],
59+
[
60+
9.5,
61+
"apli",
62+
],
63+
],
64+
watch: "ns",
65+
},
66+
SYSVARS: {
67+
io: 1,
68+
ml: 1,
69+
},
70+
USER: {
71+
},
72+
}

packages_dev/apl-buildlist.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ packageID: [ "aplteam-WinReg-5.0.2", "aplteam-Tester2-3.2.7", "aplteam-FilesAndDirs-5.1.5", "aplteam-CodeCoverage-0.9.1", "aplteam-APLTreeUtils2-1.1.3", "aplteam-OS-3.0.1", "aplteam-IniFiles-5.0.3", ], principal: [ 1, 1, 1, 1, 1, 0, 0, ], url: [ "https://tatin.dev/", "https://tatin.dev/", "https://tatin.dev/", "https://tatin.dev/", "https://tatin.dev/", "https://tatin.dev/", "https://tatin.dev/", ],}
1+
{ packageID: [ "aplteam-WinReg-5.0.4", "aplteam-Tester2-3.5.0", "aplteam-FilesAndDirs-5.5.0", "aplteam-CommTools-1.5.0", "aplteam-CodeCoverage-0.10.2", "aplteam-APLTreeUtils2-1.2.0", "aplteam-OS-3.0.1", "aplteam-IniFiles-5.0.3", ], principal: [ 1, 1, 1, 1, 1, 1, 0, 0, ], url: [ "https://tatin.dev/", "https://tatin.dev/", "https://tatin.dev/", "https://tatin.dev/", "https://tatin.dev/", "https://tatin.dev/", "https://tatin.dev/", "https://tatin.dev/", ],}

packages_dev/apl-dependencies.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
aplteam-APLTreeUtils2-1.1.3
2-
aplteam-Tester2-3.2.7
3-
aplteam-CodeCoverage-0.9.1
4-
aplteam-FilesAndDirs-5.1.5
5-
aplteam-WinReg-5.0.2
1+
aplteam-APLTreeUtils2-1.2.0
2+
aplteam-Tester2-3.5.0
3+
aplteam-CodeCoverage-0.10.2
4+
aplteam-FilesAndDirs-5.5.0
5+
aplteam-WinReg-5.0.4
6+
aplteam-CommTools-1.5.0

0 commit comments

Comments
 (0)