Skip to content

Commit e0f272e

Browse files
committed
Redesigned version 1.0.0
1 parent 73db675 commit e0f272e

File tree

249 files changed

+11809
-532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+11809
-532
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ aplcore
22
/Dist/
33
CONTINUE.dws
44
conga.crash
5-
/TestResults/
5+
personal_access_token.txt

APLSource/Admin/Make.aplf

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

APLSource/GitHubAPIv3.aplc

Lines changed: 171 additions & 368 deletions
Large diffs are not rendered by default.

APLSource/TestCases/Initial.aplf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
Initial
22
∆MyGitHubAPI←⎕NEW ##.GitHubAPIv3(,⊂'aplteam')
3+
:If FilesAndDirs.IsFile ##.TatinVars.HOME,'/personal_access_token.txt'
4+
∆MyGitHubAPI.personal_access_token←⎕TC~⍨⊃FilesAndDirs.NGET ##.TatinVars.HOME,'/personal_access_token.txt'
5+
:EndIf

APLSource/TestCases/Prepare.aplf

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +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-
testPath←(⊃1 ⎕NPARTS''),'TestResults'
9+
testPath←##.CiderConfig.HOME,'/TestResults'
510
testFilename←testPath,'/CodeCoverage'
11+
flag←0
612
:If ⎕NEXISTS testPath
7-
:If ⎕NEXISTS testFilename,'.dcf'
8-
ask←{⎕←⍵,'; 1=append, 2=replace' ⋄ a←⎕ ⋄ ~(⊂a)∊1 2:∇ ⍵ ⋄ ⊃a}
9-
answer←⊃ask'Coverage file already exists'
10-
:If 2≡answer
11-
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
1219
:EndIf
20+
:Else
21+
flag←0 CommTools.YesOrNo'Code coverage?'
1322
: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
1430
:EndIf
15-
3 ⎕MKDIR testPath ⍝
16-
T.codeCoverage←⎕NEW CodeCoverage(,⊂'#.',{⍵,'.',⍵}2↓⍕⎕THIS.##)
17-
T.codeCoverage.filename←testFilename
18-
⍝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

APLSource/TestCases/Test_GetRelease_005.aplf

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
R←Test_GetRelease_005(stopFlag batchFlag);⎕TRAP;data;more;rc
1+
R←Test_GetRelease_005(stopFlag batchFlag);⎕TRAP;data
22
⍝ Get information regarding the latest release with the dedicated method `GetLatestReleaseInfo`
33
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N')
44
R←T._Failed
5-
(rc more data)←∆MyGitHubAPI.GetLatestReleaseInfo'TestRepo'
6-
→T.PassesIf 0=rc
7-
→T.PassesIf 0=≢more
5+
data←∆MyGitHubAPI.GetLatestReleaseInfo'TestRepo'
86
→T.PassesIf'aplteam'≡data.author.login
97
→T.PassesIf'v2.0.0'≡data.tag_name
108

APLSource/TestCases/Test_GetRelease_006.aplf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
R←Test_GetRelease_006(stopFlag batchFlag);⎕TRAP;data;more;rc
1+
R←Test_GetRelease_006(stopFlag batchFlag);⎕TRAP;data
22
⍝ Get list of releases with the dedicated method `GetAllReleases`
33
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N')
44
R←T._Failed
55

6-
(rc more data)←∆MyGitHubAPI.GetAllReleases'TestRepo'
7-
→T.PassesIf 0=rc
8-
→T.PassesIf 0=≢more
6+
data←∆MyGitHubAPI.GetAllReleases'TestRepo'
7+
→T.PassesIf(≢data)∊3 4 ⍝ Only users with "Push" rights will see the draft release!
8+
9+
data←1 ∆MyGitHubAPI.GetAllReleases'TestRepo'
910
→T.PassesIf(≢data.name)∊3 4 ⍝ Only users with "Push" rights will see the draft release!
1011

1112
R←T._OK

APLSource/TestCases/Test_GetRelease_007.aplf

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
R←Test_GetRelease_007(stopFlag batchFlag);⎕TRAP;data;more;rc
1+
R←Test_GetRelease_007(stopFlag batchFlag);⎕TRAP;data
22
⍝ Get a specific release with `GetRelease`.
33
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N')
44
R←T._Failed
55

6-
(rc more data)←∆MyGitHubAPI.GetReleaseInfoByTagName'TestRepo' 'v1.0.0'
7-
→T.PassesIf 0=rc
8-
→T.PassesIf 0=≢more
6+
data←∆MyGitHubAPI.GetReleaseInfoByTagName'TestRepo' 'v1.0.0'
97
→T.PassesIf data.tag_name≡'v1.0.0'
108

119
R←T._OK

0 commit comments

Comments
 (0)