Skip to content

Commit

Permalink
Fully Tatin-compatible, RunTests and Make
Browse files Browse the repository at this point in the history
  • Loading branch information
aplteam committed Jan 31, 2021
1 parent 4ddb398 commit 364b73a
Show file tree
Hide file tree
Showing 39 changed files with 6,851 additions and 74 deletions.
8 changes: 6 additions & 2 deletions APLSource/Initialize.aplf
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{r}Initialize;⎕TRAP
{r}Initialize;⎕TRAP;parent
⎕TRAP0 'S'
r
{}⎕SE.UCMD'cd ',AcreConfig.ProjectFolder
⎕SE.aplteam.InitializeAPLTreeProject ⎕THIS
⎕WSIDAcreConfig.ProjectFolder,'project.dws'
parent⎕THIS
{}⎕SE.Tatin.LoadDependencies'./packages/'parent ⍝ There are not any!
parent,'.TestCases'
{}⎕SE.Tatin.LoadDependencies'./packages_dev/'parent
Done
4 changes: 2 additions & 2 deletions APLSource/TestCases/Cleanup.aplf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Cleanup;⎕USING;rk;rc
rkGetRegKey,∆Log
:If ##.WinSys.IsRunningAsAdmin
:AndIf 0rc##.WinReg.DeleteSubKey rk
:If WinSys.IsRunningAsAdmin
:AndIf 0rcWinReg.DeleteSubKey rk
'Delete this key:'
' ',rk
'from the Windows Registry failed. Please delete with the RegEditor;'
Expand Down
12 changes: 6 additions & 6 deletions APLSource/TestCases/Initial.aplf
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
https://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog(v=vs.110).aspx
⎕IO0 ⎕ML1
r0
##.FilesAndDirs.PolishCurrentDir
FilesAndDirs.PolishCurrentDir
rkGetRegKey,∆Log
:If 0=##.WinSys.IsRunningAsAdmin
:If 0=WinSys.IsRunningAsAdmin
'*** Sorry, but in order to run this test suite successfully this WS must be run as admin.'
' This is because it will add a new source:'
' ',rk
' to the "Application" log; this requires the WS to run with elevated rights.'
:Else
:If ##.WinReg.DoesKeyExist rk
rc##.WinReg.DeleteSubKey rk This may well fail even if you have admin rights. Delete key via Registry Editor then!
:If WinReg.DoesKeyExist rk
rcWinReg.DeleteSubKey rk This may well fail even if you have admin rights. Delete key via Registry Editor then!
:If 0rc
'*** Attempt to delete:'
' ',rk
' has failed: ',(##.WinSys.GetMsgFrom rc),'; rc=',rc
' has failed: ',(WinSys.GetMsgFrom rc),'; rc=',rc
:EndIf
:EndIf
:If ##.WinReg.DoesKeyExist rk
:If WinReg.DoesKeyExist rk
'*** This Windows Registry key:'
' ',rk
' does exist but MUST NOT before the test suite can be executed successfully again!'
Expand Down
21 changes: 16 additions & 5 deletions APLSource/TestCases/Prepare.aplf
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
Prepare
Prepare;testPath;testFilename;ask;answer
⎕IO1 ⎕ML1
T⎕NEW ##.Tester2 ⎕THIS
T.codeCoverage⎕NEW ##.CodeCoverage(,'#.',{,'.',}2⎕THIS.##)
T.codeCoverage←⎕NEW ##.CodeCoverage(,⊂'#.WindowsEventLog')
T.codeCoverage.filename(1 ⎕NPARTS''),'TestResults/CodeCoverage'
T⎕NEW Tester2 ⎕THIS
testPath(1 ⎕NPARTS''),'TestResults'
testFilenametestPath,'/CodeCoverage'
:If ⎕NEXISTS testPath
:If ⎕NEXISTS testFilename,'.dcf'
ask{,'; 1=append, 2=replace' a ~(a)1 2: a}
answerask'Coverage file already exists'
:If 2answer
1 ⎕NDELETE testFilename,'.dcf'
:EndIf
:EndIf
:EndIf
3 ⎕MKDIR testPath
T.codeCoverage⎕NEW CodeCoverage(,'#.',{,'.',}2⎕THIS.##)
T.codeCoverage.filenametestFilename
Done
14 changes: 5 additions & 9 deletions APLSource/TestCases/RunTests.aplf
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
RunTests;dcfFilename;htmlFilename;tno
RunTests;htmlFilename
Prepare
dcfFilename(,/¯1⎕NPARTS T.codeCoverage.filename),'.dcf'
:If ##.FilesAndDirs.IsFile dcfFilename
:AndIf ∆YesOrNo'CodeCovarge data file already exists; override?'
tnodcfFilename ⎕FTIE 0
dcfFilename ⎕FERASE tno
T.Run 1
htmlFilenameCodeCoverage.ProcessDataAndCreateReport T.codeCoverage.filename
:If 1 ∆YesOrNo'View CodeCoverage report?'
APLTreeUtils2.GoToWebPage'file://',htmlFilename
:EndIf
2 T.Run 1
htmlFilename##.CodeCoverage.ProcessDataAndCreateReport T.codeCoverage.filename
##.APLTreeUtils2.GoToWebPage'file://',htmlFilename
Done
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RTest_010(stopFlag batchFlag);q;t;all;buffer;⎕TRAP;myLog;TS;noOf;rc;log;source
RTest_Misc_010(stopFlag batchFlag);q;t;all;buffer;⎕TRAP;myLog;TS;noOf;rc;log;source
Creates a new source in the "Application" log and writes to it.
Does not only create stuff but also cleans up behind itself.

Expand Down Expand Up @@ -26,5 +26,5 @@
RT._OK

∆TidyUp:
rc##.WinReg.DeleteSubKey'HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\',source
rcWinReg.DeleteSubKey'HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\',source
(0rc)/'. ??'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RTest_011(stopFlag batchFlag);q;t;all;buffer;⎕TRAP;noOf;TS;rc;log;source
RTest_Misc_011(stopFlag batchFlag);q;t;all;buffer;⎕TRAP;noOf;TS;rc;log;source
Creates a new source without specifying the log (defaults to "Application") and writes to it.
Does not only create stuff but also cleans up behind itself.
RT._Failed
Expand Down Expand Up @@ -27,5 +27,5 @@
RT._OK

∆TidyUp:
rc##.WinReg.DeleteSubKey'HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\',source
rcWinReg.DeleteSubKey'HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\',source
(0rc)/'. ??'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RTest_012(stopFlag batchFlag);q;t;all;buffer;⎕TRAP;TS;noOf;rc;source;log
RTest_Misc_012(stopFlag batchFlag);q;t;all;buffer;⎕TRAP;TS;noOf;rc;source;log
Creates a custom log with a new source and writes to it.
Does not only create stuff but also cleans up behind itself.
RT._Failed
Expand Down Expand Up @@ -27,11 +27,11 @@
RT._OK

∆TidyUp:
rc##.WinReg.DeleteSubKey GetRegKey,log
rcWinReg.DeleteSubKey GetRegKey,log
:If 0rc
:AndIf 0=batchFlag
'*** Attempt to delete:'
' ',GetRegKey,log
' failed: ',##.WinSys.GetMsgFrom rc
' failed: ',WinSys.GetMsgFrom rc
' Make sure that you delete this before executing the test suite again!'
:EndIf
7 changes: 4 additions & 3 deletions APLSource/TestCases/Test_ZZZ_998.aplf
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
RTest_ZZZ_998(stopFlag batchFlag);⎕IO;⎕ML;⎕TRAP;report;buff
RTest_ZZZ_998(stopFlag batchFlag);⎕IO;⎕ML;⎕TRAP;report;buff;rf
Checks on two text vectors: "⍝TODO⍝" and "⍝CHECK⍝"; never fails, just reports.
⎕IO0 ⎕ML3
⎕TRAP(999 'C' '. ⍝ Deliberate error')(0 'N')
RT._OK
report''
rf##.WindowsEventLog

buffT.FindSpecialString'⍝CHECK⍝'
buffrf T.FindSpecialString'⍝CHECK⍝'
buff(buff[;0]¨⎕XSI[0])buff remove caller
:If 0buff
report,(' ⍝CHECK⍝ found:'),(' '),¨buff
:EndIf
buffT.FindSpecialString'⍝TODO⍝'
buffrf T.FindSpecialString'⍝TODO⍝'
buff(buff[;0]¨⎕XSI[0])buff remove caller
:If 0buff
report,(' ⍝TODO⍝ found:'),(' '),¨buff
Expand Down
33 changes: 0 additions & 33 deletions APLSource/TestCases/Test_ZZZ_999.aplf

This file was deleted.

2 changes: 1 addition & 1 deletion APLSource/WindowsEventLog.aplc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

rVersion
:Access Public Shared
r'WindowsEventLog' '3.0.0.6' '2020-09-21'
r'WindowsEventLog' '3.0.0.10' '2020-09-21'

History
Expand Down
Binary file modified Make/Make.DWS
Binary file not shown.
1 change: 1 addition & 0 deletions Packages_dev/apl-buildlist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ depth: [ 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, ], packageID: [ "aplteam-APLTreeUtils2-1.1.0", "aplteam-FilesAndDirs-5.0.0", "aplteam-OS-3.0.0", "aplteam-Tester2-3.1.0.90", "aplteam-CodeCoverage-0.7.1", "aplteam-WinReg-5.0.1", "aplteam-WinSys-5.0.0", "aplteam-OS-3.0.0", "aplteam-IniFiles-5.0.1", "aplteam-APLTreeUtils2-1.1.0", ], url: [ "https://tatin.dev/aplteam-APLTreeUtils2-1.1.0", "https://tatin.dev/aplteam-FilesAndDirs-5.0.0", "https://tatin.dev/aplteam-OS-3.0.0", "https://tatin.dev/aplteam-Tester2-3.1.0.90", "https://tatin.dev/aplteam-CodeCoverage-0.7.1", "https://tatin.dev/aplteam-WinReg-5.0.1", "https://tatin.dev/aplteam-WinSys-5.0.0", "https://tatin.dev/aplteam-OS-3.0.0", "https://tatin.dev/aplteam-IniFiles-5.0.1", "https://tatin.dev/aplteam-APLTreeUtils2-1.1.0", ],}
Expand Down
7 changes: 7 additions & 0 deletions Packages_dev/apl-dependencies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
aplteam-APLTreeUtils2-1.1.0
aplteam-FilesAndDirs-5.0.0
aplteam-OS-3.0.0
aplteam-Tester2-3.1.0.90
aplteam-CodeCoverage-0.7.1
aplteam-WinReg-5.0.1
aplteam-WinSys-5.0.0
Loading

0 comments on commit 364b73a

Please sign in to comment.