Skip to content

Commit 17e577f

Browse files
committed
Test cases amended
1 parent 31afd4f commit 17e577f

Some content is hidden

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

64 files changed

+2381
-55
lines changed

APLSource/Cider/LoadTatinDependencies.aplf

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,19 @@
3636
p'Packages in ',folder,' need attention!'
3737
:EndIf
3838
:ElseIf ∨/'Invalid entry:'⍷qdmx.EM
39-
q←'ReinstallBecauseOfInvalidPkg@There are invalid entries in the dependency list; re-install?'
40-
:If C.YesOrNo q
41-
parms←⎕SE.Tatin.CreateReInstallParms
42-
parms.batch←batch
43-
parms ⎕SE.Tatin.ReInstallDependencies folder
44-
→∆Retry
45-
:Else
46-
p'Packages in ',folder,' need attention!'
39+
:If batch
4740
r←FAILURE
41+
:Else
42+
q←'ReinstallBecauseOfInvalidPkg@There are invalid entries in the dependency list; re-install?'
43+
:If C.YesOrNo q
44+
parms←⎕SE.Tatin.CreateReInstallParms
45+
parms.batch←batch
46+
parms ⎕SE.Tatin.ReInstallDependencies folder
47+
→∆Retry
48+
:Else
49+
p'Packages in ',folder,' need attention!'
50+
r←FAILURE
51+
:EndIf
4852
:EndIf
4953
:Else
5054
p qdmx.EM

APLSource/Cider/OpenProject.aplf

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
⍝ Open a Cider project.\\
33
⍝ `y` must be one of:
44
⍝ * a namespace holding all required parameters. Such a namespace can be created by calling `CreateOpenParms`
5-
⍝ * A character vector holding the full path to a project
5+
⍝ * A character vector holding the full path to a project\\
6+
⍝ The function returns either FAILURE or SUCCESS. This refers to the principal operation: opening the project.
7+
⍝ However, if something like loading dependencies goes wrong then messages are printed to the session.\\
8+
⍝ In case `batch` is 1 things are different, however: in that case an error is thrown for all essential parts
9+
⍝ of the operation. That includes loading any dependencies but excludes non-essential stuff like a Git status report.
610
successFlag←FAILURE ⋄ ∆LOG←''
711
:If 80=⎕DR y
812
parms←CreateOpenParms''
@@ -68,13 +72,14 @@
6872
:If parms.importFlag
6973
res←linkOptions ⎕SE.Link.Import projectSpace_ source ⍝ Get the code into the WS
7074
dmx←⎕DMX
71-
('LINK failed to import the code (,',dmx.EM,')')⎕SIGNAL dmx.EN/⍨∨/'Error:'⍷res
75+
('LINK failed to import the code (,',dmx.EM,')')Assert~∨/'Error:'⍷res
7276
p'Code imported'
7377
:Else
7478
res←linkOptions ⎕SE.Link.Create projectSpace_ source ⍝ Get the code into the WS
7579
dmx←⎕DMX
76-
('LINK failed to load the code (',dmx.EM,')')⎕SIGNAL dmx.EN/⍨∨/'Error:'⍷res
80+
('LINK failed to load the code (',dmx.EM,')')Assert~∨/'Error:'⍷res
7781
:If ∨/'ERRORS ENCOUNTERED:'⍷res
82+
res Assert 0=parms.batch
7883
(1 parms.batch)p res
7984
:EndIf
8085
(1 parms.batch)p ReportLinkSettings config
@@ -91,19 +96,24 @@
9196
buff←''
9297
buff,←⊂'ERROR: Checking Tatin package status in ',parms.folder
9398
buff,←⊂' failed: ',{(1⊃⍵),' in ',{⍵↑⍨⍵⍳']'}(2⊃⍵)}qdmx.DM
99+
buff Assert 0=parms.batch
94100
(1 parms.batch)p buff
95101
:EndTrap
96102
:EndIf
97103
:Trap 0
98104
:If 0=parms.(verbose batch)LoadTatinDependencies config parms.folder(⍕projectSpace_)
99-
(1 parms.batch)p'Package folder ',parms.folder,' needs attention!'
105+
buff←'Package folder ',parms.folder,' needs attention!'
106+
buff Assert 0=parms.batch
107+
1 p buff
100108
:EndIf
101109
:Else
102110
⎕SE._Tatin.Client.CloseConnections 1 ⍝ Just in case...
103111
qdmx←⎕DMX
104112
buff←''
105113
buff,←⊂'ERROR: loading Tatin packages from ',parms.folder
106114
buff,←⊂' failed: ',{(1⊃⍵),' in ',{⍵↑⍨⍵⍳']'}(2⊃⍵)}qdmx.DM
115+
buff←1↓⊃,/(⎕UCS 13),¨buff
116+
buff Assert 0=parms.batch
107117
(1 parms.batch)p buff
108118
:EndTrap
109119
:EndIf
@@ -117,6 +127,7 @@
117127
buff←''
118128
buff,←⊂'ERROR: loading NuGet packages from ',parms.folder
119129
buff,←⊂' failed: ',{(1⊃⍵),' in ',{⍵↑⍨⍵⍳']'}(2⊃⍵)}qdmx.DM
130+
buff Assert 0=parms.batch
120131
(1 parms.batch)p buff
121132
:EndTrap
122133
:EndIf

APLSource/Cider/PerformConfigChecks.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
successFlag←⍬
44
report←''
55
tatinFolders←('dependencies' 'dependencies_dev'GetTatinDependencies¨⊂config)~⊂''
6-
⍝TODO⍝ ⍝TODO⍝ Checks on NuGet?!
6+
⍝TODO⍝ ⍝TODO⍝ Add checks on NuGet?!
77
:For i :In ⍳≢tatinFolders
88
tatinFolder←i⊃tatinFolders
99
this←i⊃'dependencies' 'dependencies_dev'

APLSource/Cider/Version.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
r←Version
22
⍝ See als History
3-
r←'0.37.5+634'
3+
r←'0.37.5+641'

APLSource/TestCases/Test_OpenAndClose_002.aplf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
R←Test_OpenAndClose_002(stopFlag batchFlag);⎕TRAP;tempDir;sourceFolder;list;rc;ref
2-
Open a (new) project and then close it by path
2+
Create and open a project and then close it by path
33
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
44
R←T._Failed
55

@@ -20,6 +20,7 @@
2020

2121
∆TidyUp:
2222
ref.Cleanup
23+
{}⎕SE.Link.Break #.Foo
2324
rc←FilesAndDirs.RmDir tempDir,'/..'
2425
Assert 0=+/∊rc
2526
⍝Done

APLSource/TestCases/Test_OpenAndClose_003.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
ref←∆GetRefToCommTools
1111
ref.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n'
12-
{}∆UCMD'CreateProject "',tempDir,'" -noEdit -acceptConfig -batch -ignoreUserExec'
12+
res←∆UCMD'CreateProject "',tempDir,'" -noEdit -acceptConfig -batch -ignoreUserExec'
1313

1414
list←##.Cider.ListOpenProjects 0
1515
→T.GoToTidyUp 0≠##.Cider.CloseProject'DoesNotExist'
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
R←Test_Open_071(stopFlag batchFlag);⎕TRAP;parms;success;log
2-
⍝ Open a project that has a variable that is syntactially incorrect, causing a warning
1+
R←Test_Open_071(stopFlag batchFlag);⎕TRAP;parms;success;log;qdmx
2+
⍝ Open a project that has a variable that is syntactically incorrect, causing an error
33
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
44
R←T._Failed
55

@@ -13,15 +13,18 @@
1313
parms.ignoreUserExec←1
1414
parms.batch←1
1515
##.Cider.C.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n'
16-
(success log)←##.Cider.OpenProject parms
17-
Assert success
18-
→T.GoToTidyUp~∨/,'1 import(s) failed:'⍷log
19-
→T.GoToTidyUp~∨/,'History.apla'⍷log
16+
:Trap 0
17+
(success log)←##.Cider.OpenProject parms
18+
→T.GoToTidyUp 1
19+
:Else
20+
qdmx←⎕DMX
21+
→T.GoToTidyUp~∨/'ERRORS ENCOUNTERED:'⍷∊qdmx.EM
22+
:EndTrap
2023

2124
R←T._OK
2225

2326
∆TidyUp:
2427
##.Cider.C.Cleanup
25-
Assert ⎕SE.Cider.CloseProject'#.TEMP.booproj'
28+
{}⎕SE.Cider.CloseProject'#.TEMP.booproj'
2629
#.⎕EX'TEMP'
2730
⍝Done

APLSource/TestCases/Test_Open_082.aplf

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
R←Test_Open_082(stopFlag batchFlag);⎕TRAP;parms;r;rc;tempDir;log;success
1+
R←Test_Open_082(stopFlag batchFlag);⎕TRAP;parms;r;rc;tempDir;log;success;qdmx
22
⍝ Tries to open a project that has packages but the installed packages and the build list don't fit
33
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
44
R←T._Failed
@@ -15,10 +15,14 @@
1515
parms.batch←1
1616
##.Cider.C.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n'
1717
##.Cider.C.YesOrNo_Answers⍪←1 2⍴'ReinstallBecauseOfInconsistency@' 'y'
18-
(success log)←##.Cider.OpenProject parms
19-
→T.GoToTidyUp∨/'ERROR'⍷log
20-
→T.GoToTidyUp'#._tatin.aplteam_Tester2_3_5_0.Tester2'≢⍕#.TEMP.fooproj.Tester2 ⍝ VALUE ERROR? Try again, but first execute stuff after ∆TidyUp
21-
→T.GoToTidyUp'#._tatin.aplteam_CodeCoverage_0_7_3.CodeCoverage'≢⍕#.TEMP.fooproj.CodeCoverage
18+
19+
:Trap 0
20+
(success log)←##.Cider.OpenProject parms
21+
→T.GoToTidyUp 1
22+
:Else
23+
qdmx←⎕DMX
24+
→T.GoToTidyUp~qdmx.EM ∆StartsWith'ERROR: loading Tatin packages from'
25+
:EndTrap
2226

2327
R←T._OK
2428

APLSource/TestCases/Test_Tatin_005.aplf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
R←Test_Tatin_005(stopFlag batchFlag);⎕TRAP;res;folder;parms;rc;log
1+
R←Test_Tatin_005(stopFlag batchFlag);⎕TRAP;res;folder;parms;rc;log;qdmx
22
⍝ Attempt to Open a project with Tatin packages via an absolute path (invalid)
33
⍝ Problem is reported but Cider carries on anyway
44
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
@@ -13,8 +13,13 @@
1313
parms.ignoreUserExec←1
1414
parms.batch←1
1515
##.Cider.C.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n'
16-
(res log)←##.Cider.OpenProject parms
17-
→T.GoToTidyUp~∨/'ERROR:'⍷∊log
16+
:Trap 0
17+
(res log)←##.Cider.OpenProject parms
18+
→T.GoToTidyUp 1
19+
:Else
20+
qdmx←⎕DMX
21+
→T.GoToTidyUp~∨/'ERROR:'⍷qdmx.EM
22+
:EndTrap
1823

1924
R←T._OK
2025

APLSource/TestCases/∆GetRefToCommTools.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
⍝ to pretend a human being making decisions/selections.
66
:If 0<⎕SE.Cider.⎕NC'DEVELOPMENT'
77
:AndIf 0<⎕SE.Cider.DEVELOPMENT
8-
r←#.Cider.Cider.##.C
8+
r←#.Cider.Cider.CommTools
99
:Else
1010
r←⎕SE.Cider.##.C
1111
:EndIf

0 commit comments

Comments
 (0)