diff --git a/.gitignore b/.gitignore index 0750386..599a9bc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ -.acre +.acre/ +aplcore Dist/ -Development.dws \ No newline at end of file +change_history/ +.gitignore diff --git a/APLSource/EventCodes.aplc b/APLSource/EventCodes.aplc index 641d015..6c01797 100644 --- a/APLSource/EventCodes.aplc +++ b/APLSource/EventCodes.aplc @@ -62,13 +62,15 @@ ∇ r←Version :Access Public Shared - r←({⍵}⍕⎕THIS)'2.0.0.15' '2020-03-22' + r←({⍵}⍕⎕THIS)'3.0.0.16' '2020-09-21' ∇ ∇ History :Access Public Shared - ⍝ * 2.0.0 - ⍝ * BREAKING CHANGE: File extension changed from .DYALOG to .APLC + ⍝ * 3.0.0 + ⍝ * BREAKING CHANGES: + ⍝ * Requires now Dyalog 18.0 or better + ⍝ * Is delivered as a Tatin package ⍝\\ ⍝ For information regarding older versions see ∇ diff --git a/APLSource/Initialize.aplf b/APLSource/Initialize.aplf new file mode 100644 index 0000000..850c2cc --- /dev/null +++ b/APLSource/Initialize.aplf @@ -0,0 +1,6 @@ + {r}←Initialize;⎕TRAP + ⎕TRAP←0 'S' + r←⍬ + {}⎕SE.UCMD'cd ',AcreConfig.ProjectFolder + ⎕SE.aplteam.InitializeAPLTreeProject ⎕THIS +⍝Done diff --git a/APLSource/TestCases/Prepare.aplf b/APLSource/TestCases/Prepare.aplf index 0097eb6..bad550b 100644 --- a/APLSource/TestCases/Prepare.aplf +++ b/APLSource/TestCases/Prepare.aplf @@ -1,2 +1,6 @@ Prepare + ⎕IO←1 ⋄ ⎕ML←1 T←⎕NEW ##.Tester2 ⎕THIS + T.codeCoverage←⎕NEW ##.CodeCoverage(,⊂'#.',{⍵,'.',⍵}2↓⍕⎕THIS.##) + T.codeCoverage.filename←(⊃1 ⎕NPARTS''),'TestResults/CodeCoverage' +⍝Done diff --git a/APLSource/TestCases/RunTests.aplf b/APLSource/TestCases/RunTests.aplf new file mode 100644 index 0000000..857f5a3 --- /dev/null +++ b/APLSource/TestCases/RunTests.aplf @@ -0,0 +1,12 @@ + RunTests;dcfFilename;htmlFilename;tno + Prepare + dcfFilename←(⊃,/¯1↓⎕NPARTS T.codeCoverage.filename),'.dcf' + :If ##.FilesAndDirs.IsFile dcfFilename + :AndIf ∆YesOrNo'CodeCovarge data file already exists; override?' + tno←dcfFilename ⎕FTIE 0 + dcfFilename ⎕FERASE tno + :EndIf + T.Run 1 + htmlFilename←##.CodeCoverage.ProcessDataAndCreateReport T.codeCoverage.filename + ##.APLTreeUtils2.GoToWebPage'file://',htmlFilename +⍝Done diff --git a/APLSource/TestCases/Test_30.aplf b/APLSource/TestCases/Test_30.aplf index fa2d025..e09498a 100644 --- a/APLSource/TestCases/Test_30.aplf +++ b/APLSource/TestCases/Test_30.aplf @@ -5,7 +5,7 @@ list←⌽GetInstalledAPLs ⍬ :Repeat - version←3⊃' '##.APLTreeUtils.Split⊃list + version←3⊃' '##.APLTreeUtils2.Split⊃list :If 0=≢errors←∆GetErrorsFromHelpPage'http://help.dyalog.com/',version,'/Content/Language/System%20Functions/trap.htm' list←1↓list :EndIf diff --git a/APLSource/TestCases/Test_ZZZ_998.aplf b/APLSource/TestCases/Test_ZZZ_998.aplf index 0363a6c..3db8962 100644 --- a/APLSource/TestCases/Test_ZZZ_998.aplf +++ b/APLSource/TestCases/Test_ZZZ_998.aplf @@ -1,23 +1,22 @@ R←Test_ZZZ_998(stopFlag batchFlag);⎕IO;⎕ML;⎕TRAP;report;buff;xml;source ⍝ Checks on two text vectors: "⍝TODO⍝" and "⍝CHECK⍝"; never fails, just reports. - ⎕IO←0 ⋄ ⎕ML←3 ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') R←T._OK report←'' - xml←⎕XML'flat'##.APLTreeUtils.ReadUtf8File'publish.config' - source←2⊃xml[xml[;1]⍳⊂'container';] + xml←⎕XML⊃⎕NGET'publish.config' + source←3⊃xml[xml[;2]⍳⊂'container';] buff←T.FindSpecialString'⍝CHECK⍝' - buff←(buff[;0]≢¨⎕XSI[0])⌿buff ⍝ remove caller - :If ~0∊⍴buff + buff←(buff[;1]≢¨⎕XSI[1])⌿buff ⍝ remove caller + :If 0≠≢buff report,←↓(⊂' ⍝CHECK⍝ found:'),(⊂' '),¨buff :EndIf buff←T.FindSpecialString'⍝TODO⍝' - buff←(buff[;0]≢¨⎕XSI[0])⌿buff ⍝ remove caller - :If ~0∊⍴buff + buff←(buff[;1]≢¨⎕XSI[1])⌿buff ⍝ remove caller + :If 0≠≢buff report,←↓(⊂' ⍝TODO⍝ found:'),(⊂' '),¨buff :EndIf - :If 1=⍴,report + :If 1=≢report report,←⊂' Nothing found!' :Else ⎕←'Checking for ⍝TODO⍝ and ⍝CHECK⍝ '{⍵↑,'--- ',⍺,' ',⍵⍴'-'}80⌊⎕PW-1 diff --git a/APLSource/TestCases/Test_ZZZ_999.aplf b/APLSource/TestCases/Test_ZZZ_999.aplf index 9424143..25467f6 100644 --- a/APLSource/TestCases/Test_ZZZ_999.aplf +++ b/APLSource/TestCases/Test_ZZZ_999.aplf @@ -17,7 +17,7 @@ f1∨←~∧/⎕D∊⍨d~'-' ⍝ publish.config must be in line with what "Version" returns of course: - xml←⎕XML'flat'##.APLTreeUtils.ReadUtf8File'publish.config' + xml←⎕XML⊃⎕NGET'publish.config' f2←v≢(2+⎕IO)⊃xml[xml[;1+⎕IO]⍳⊂'version';] f2∨←d≢(2+⎕IO)⊃xml[xml[;1+⎕IO]⍳⊂'date';] diff --git "a/APLSource/TestCases/\342\210\206YesOrNo.aplf" "b/APLSource/TestCases/\342\210\206YesOrNo.aplf" new file mode 100644 index 0000000..2f3b5fc --- /dev/null +++ "b/APLSource/TestCases/\342\210\206YesOrNo.aplf" @@ -0,0 +1,51 @@ + yesOrNo←{default}∆YesOrNo question;isOkay;answer;add;dtb;answer2 +⍝ Ask a simple question and allows just "Yes" or "No" as answers. +⍝ You may specify a default via the optional left argument which when specified +⍝ rules what happens when the user just presses . +⍝ `default` must be either 1 (yes) or 0 (no). +⍝ Note that this function does not work as expected when traced! + isOkay←0 + default←{0<⎕NC ⍵:⍎⍵ ⋄ ''}'default' + isOkay←0 + :If ~0∊⍴default + 'Left argument must be a scalar'⎕SIGNAL 11/⍨1≠⍴,default + :AndIf ~default∊0 1 + 'The left argument. if specified, must be a Boolean or empty'⎕SIGNAL 11 + :EndIf + :If 0=≢default + add←' (y/n) ' + :Else + :If default + add←' (Y/n) ' + :Else + add←' (y/N) ' + :EndIf + :EndIf + :If 1<≡question + ((⍴question)⊃question)←((⍴question)⊃question),add + question←⍪question + :Else + question←question,add + :EndIf + :Repeat + ⍞←question + answer←⍞ + :If answer≡question ⍝ Did... (since version 18.0 trailing blanks are not removed anynmore) + :OrIf (≢answer)=¯1+≢question ⍝ ..the ... + :OrIf 0=≢answer ⍝ ...user just... + dtb←{⍵↓⍨-+/∧\' '=⌽⍵} + answer2←dtb answer + :OrIf answer2≡((-≢answer2)↑(⎕UCS 10){~⍺∊⍵:⍵ ⋄ ' ',dtb ⍺{⌽⍵↑⍨1+⍵⍳⍺}⌽⍵}question) ⍝ ...press ? + :If 0≠≢default + yesOrNo←default + isOkay←1 + :EndIf + :Else + answer←¯1↑{⍵↓⍨-+/∧\' '=⌽⍵}answer + :If answer∊'YyNn' + isOkay←1 + yesOrNo←answer∊'Yy' + :EndIf + :EndIf + :Until isOkay +⍝Done diff --git a/Make/Make.bat b/Make/Make.bat deleted file mode 100644 index 19a4a4a..0000000 --- a/Make/Make.bat +++ /dev/null @@ -1,2 +0,0 @@ -"C:\Program Files\Dyalog\Dyalog APL-64 16.0 Unicode\dyalog.exe" %1 maxw=64000 %2 %3 %4 -IF %ERRORLEVEL% NEQ 0 echo ERROR \ No newline at end of file diff --git a/TestResults/CodeCoverage.dcf b/TestResults/CodeCoverage.dcf new file mode 100644 index 0000000..d716c3e Binary files /dev/null and b/TestResults/CodeCoverage.dcf differ diff --git a/TestResults/CodeCoverage.html b/TestResults/CodeCoverage.html new file mode 100644 index 0000000..79bf4f5 --- /dev/null +++ b/TestResults/CodeCoverage.html @@ -0,0 +1,135 @@ + + + +Coverage + + + + +

Coverage Report

+

Watched: 5 fns/opr within #.EventCodes.EventCodes

+

Overall 91% of the testable code is covered.

+

(Comment lines, empty lines, all :End* lines etc. are all ignored)

+

3 of the fns/opr are 100% covered.

+
+

2 are partly covered:

+ + + + + + + + +
Function/OperatorLines not executedCoverage
#.EventCodes.EventCodes.List16,1883%12
#.EventCodes.EventCodes.QEM1192%13
+
+ + + diff --git a/acre.config b/acre.config index e6a45a7..ac6fa35 100644 --- a/acre.config +++ b/acre.config @@ -2,5 +2,5 @@ "CaseCode": "Off", "Open": "", "ProjectSpace": "#.EventCodes", - "StartUp": "" + "StartUp": "Initialize" } \ No newline at end of file diff --git a/apl-package.json b/apl-package.json new file mode 100644 index 0000000..d55ab50 --- /dev/null +++ b/apl-package.json @@ -0,0 +1 @@ +{ alias: "", api: "EventCodes", date: "2020-03-22", description: "Constants with meaningful names for Dyalog error codes", files: "", group: "aplteam", name: "EventCodes", project_url: "https://github.com/aplteam/EventCodes", source: "APLSource/EventCodes.aplc", tags: "aplteam;event-constants;windows;linux;mac-os", version: "2.0.0", } diff --git a/publish.config b/publish.config index 5a06050..4c6017d 100644 --- a/publish.config +++ b/publish.config @@ -1 +1 @@ - 2.0.0 2020-03-22 #.EventCodes 1 15 1 1 \ No newline at end of file + 3.0.0 2020-09-21 #.EventCodes 1 16 1 1 Constants with meaningful names for Dyalog error codes apltree;event-constants;Windows;Linux;Mac-OS