From 2f631906e4a4d96052208ee5086a7e773a132b65 Mon Sep 17 00:00:00 2001 From: Sandra Persson Date: Thu, 2 Oct 2025 15:15:57 +0200 Subject: [PATCH 1/4] Write testname and res to stdout --- APLSource/Core/RunTestsuite.aplf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/APLSource/Core/RunTestsuite.aplf b/APLSource/Core/RunTestsuite.aplf index d5e3396..ce981bd 100644 --- a/APLSource/Core/RunTestsuite.aplf +++ b/APLSource/Core/RunTestsuite.aplf @@ -1,4 +1,4 @@ - res←cfg RunTestsuite testspace;res;allfns;testfns;testfn;ai;testcase;setupfns;cleanupfns;lasttest;assertCnts +res←cfg RunTestsuite testspace;res;allfns;testfns;testfn;ai;testcase;setupfns;cleanupfns;lasttest;assertCnts;maxstrlen ⍝ Run tests using configuraition in cfg ⍝ Return a result space. @@ -14,11 +14,13 @@ testspace.⍎¨setupfns assertCnts←GetAssertionCount + maxstrlen←⌈/≢¨testfns :For testfn :In testfns lasttest←testfn≡⊃¯1↑testfns ai←⎕AI testcase←cfg RunTest testspace testfn testcase.TimeElapsed←(3⊃⎕AI-ai)÷1000 + ⎕←'Test: ',testfn,((maxstrlen-≢testfn)/' '),' Result: ',testcase.ResultCode{⊃n/⍨⍺=⍵⍎¨n←⍵.⎕NL ¯2}API.TESTRESULT :If testcase.ResultCode≠API.TESTRESULT.PASS :AndIf ~lasttest testspace.⍎¨cleanupfns,setupfns @@ -26,7 +28,7 @@ res.Testcases,←testcase assertCnts,←GetAssertionCount :EndFor - res.Assertions←+/res.Testcases.Assertions← ¯2-/assertCnts + res.Assertions←+/res.Testcases.Assertions←¯2-/assertCnts testspace.⍎¨cleanupfns res.TimeElapsed←86400×-/1 ⎕DT ⎕TS res.Timestamp res.Tests←≢res.Testcases From 592e966f893aefaecd305da9cf6c0f7e26694044 Mon Sep 17 00:00:00 2001 From: Sandra Persson Date: Mon, 6 Oct 2025 13:51:40 +0200 Subject: [PATCH 2/4] check write permission --- .github/workflows/Run-Tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Run-Tests.yml b/.github/workflows/Run-Tests.yml index 5f3923a..2add26f 100644 --- a/.github/workflows/Run-Tests.yml +++ b/.github/workflows/Run-Tests.yml @@ -7,6 +7,7 @@ on: permissions: id-token: write contents: read + checks: write jobs: Run-Tests: From 87675c1170d1b77ada03944632e91ab0b2462ad4 Mon Sep 17 00:00:00 2001 From: Sandra Persson Date: Mon, 6 Oct 2025 14:01:11 +0200 Subject: [PATCH 3/4] modify according to code review --- APLSource/Core/RunTestsuite.aplf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/APLSource/Core/RunTestsuite.aplf b/APLSource/Core/RunTestsuite.aplf index ce981bd..1de9e45 100644 --- a/APLSource/Core/RunTestsuite.aplf +++ b/APLSource/Core/RunTestsuite.aplf @@ -1,4 +1,4 @@ -res←cfg RunTestsuite testspace;res;allfns;testfns;testfn;ai;testcase;setupfns;cleanupfns;lasttest;assertCnts;maxstrlen + res←cfg RunTestsuite testspace;res;allfns;testfns;testfn;ai;testcase;setupfns;cleanupfns;lasttest;assertCnts;resultSymbol ⍝ Run tests using configuraition in cfg ⍝ Return a result space. @@ -14,13 +14,14 @@ res←cfg RunTestsuite testspace;res;allfns;testfns;testfn;ai;testcase;setupfns; testspace.⍎¨setupfns assertCnts←GetAssertionCount - maxstrlen←⌈/≢¨testfns :For testfn :In testfns lasttest←testfn≡⊃¯1↑testfns + ⍞←(⎕UCS 9203 32),testfn ai←⎕AI testcase←cfg RunTest testspace testfn testcase.TimeElapsed←(3⊃⎕AI-ai)÷1000 - ⎕←'Test: ',testfn,((maxstrlen-≢testfn)/' '),' Result: ',testcase.ResultCode{⊃n/⍨⍺=⍵⍎¨n←⍵.⎕NL ¯2}API.TESTRESULT + resultSymbol←⎕UCS 9989 10060 9197 9888[1+testcase.ResultCode] + ⍞←((2+≢testfn)⍴⎕UCS 8),resultSymbol,' ',testfn,⎕UCS 10 :If testcase.ResultCode≠API.TESTRESULT.PASS :AndIf ~lasttest testspace.⍎¨cleanupfns,setupfns From 344e68e4ecddd04b242be5f40eb9f1b08f4e4288 Mon Sep 17 00:00:00 2001 From: Sandra Persson Date: Mon, 6 Oct 2025 14:22:18 +0200 Subject: [PATCH 4/4] don't use backspace --- APLSource/Core/RunTestsuite.aplf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/APLSource/Core/RunTestsuite.aplf b/APLSource/Core/RunTestsuite.aplf index 1de9e45..512e9d3 100644 --- a/APLSource/Core/RunTestsuite.aplf +++ b/APLSource/Core/RunTestsuite.aplf @@ -16,12 +16,12 @@ assertCnts←GetAssertionCount :For testfn :In testfns lasttest←testfn≡⊃¯1↑testfns - ⍞←(⎕UCS 9203 32),testfn + ⍞←testfn,': ' ai←⎕AI testcase←cfg RunTest testspace testfn testcase.TimeElapsed←(3⊃⎕AI-ai)÷1000 resultSymbol←⎕UCS 9989 10060 9197 9888[1+testcase.ResultCode] - ⍞←((2+≢testfn)⍴⎕UCS 8),resultSymbol,' ',testfn,⎕UCS 10 + ⍞←resultSymbol,⎕UCS 10 :If testcase.ResultCode≠API.TESTRESULT.PASS :AndIf ~lasttest testspace.⍎¨cleanupfns,setupfns