Making the reports work

This commit is contained in:
retropikzel 2024-10-05 14:17:45 +03:00
parent 05d07cf71f
commit 66242c5887
7 changed files with 76 additions and 85 deletions

52
Jenkinsfile vendored
View File

@ -67,8 +67,8 @@ pipeline {
sh 'find . -name "*.o" -delete'
sh 'find . -name "*.o" -delete'
sh 'chibi-scheme -I ./snow/chibi r7rs-tests.scm> r7rs-test.log'
sh 'cat r7rs-test.log'
sh 'chibi-scheme -I ./snow/chibi r7rs-tests.scm> r7rs-tests.log'
sh 'cat r7rs-tests.log'
sh 'for f in *.log; do cp -- "$f" "reports/chibi-$f"; done'
sh 'ls reports'
stash name: 'reports', includes: 'reports/*'
@ -100,8 +100,8 @@ pipeline {
sh 'find . -name "*.o" -delete'
sh 'find . -name "*.o" -delete'
sh ' ls && cp snow/chibi/term/ansi.sld snow.chibi.term.ansi.sld && csc -include-path ./snow/chibi -include-path ./snow/chibi/term -X r7rs -R r7rs -s -J snow.chibi.term.ansi.sld && cp snow/chibi/optional.sld snow.chibi.optional.sld && csc -include-path ./snow/chibi -include-path ./snow/chibi/term -X r7rs -R r7rs -s -J snow.chibi.optional.sld && cp snow/chibi/diff.sld snow.chibi.diff.sld && csc -include-path ./snow/chibi -include-path ./snow/chibi/term -X r7rs -R r7rs -s -J snow.chibi.diff.sld && cp snow/chibi/test.sld snow.chibi.test.sld && csc -include-path ./snow/chibi -include-path ./snow/chibi/term -X r7rs -R r7rs -s -J snow.chibi.test.sld'
sh 'csc -include-path ./snow/chibi -X r7rs -R r7rs r7rs-tests.scm && ./r7rs-test && rm r7rs-test> r7rs-test.log'
sh 'cat r7rs-test.log'
sh 'csc -include-path ./snow/chibi -X r7rs -R r7rs r7rs-tests.scm && ./r7rs-tests && rm r7rs-tests> r7rs-tests.log'
sh 'cat r7rs-tests.log'
sh 'for f in *.log; do cp -- "$f" "reports/chicken-$f"; done'
sh 'ls reports'
stash name: 'reports', includes: 'reports/*'
@ -133,8 +133,8 @@ pipeline {
sh 'find . -name "*.o" -delete'
sh 'find . -name "*.o" -delete'
sh ' ls && cyclone -A . snow/chibi/term/ansi.sld && cyclone -A . snow/chibi/optional.sld && cyclone -A . snow/chibi/diff.sld && cyclone -A . snow/chibi/test.sld'
sh 'cyclone -A . r7rs-tests.scm && ./r7rs-test && rm r7rs-test> r7rs-test.log'
sh 'cat r7rs-test.log'
sh 'cyclone -A . r7rs-tests.scm && ./r7rs-tests && rm r7rs-tests> r7rs-tests.log'
sh 'cat r7rs-tests.log'
sh 'for f in *.log; do cp -- "$f" "reports/cyclone-$f"; done'
sh 'ls reports'
stash name: 'reports', includes: 'reports/*'
@ -166,8 +166,8 @@ pipeline {
sh 'find . -name "*.o" -delete'
sh 'find . -name "*.o" -delete'
sh ' ls && gsc . snow/chibi/term/ansi && gsc . snow/chibi/optional && gsc . snow/chibi/diff && gsc . snow/chibi/test'
sh 'gsc -exe . -nopreload r7rs-tests.scm && ./r7rs-test && rm r7rs-test> r7rs-test.log'
sh 'cat r7rs-test.log'
sh 'gsc -exe . -nopreload r7rs-tests.scm && ./r7rs-tests && rm r7rs-tests> r7rs-tests.log'
sh 'cat r7rs-tests.log'
sh 'for f in *.log; do cp -- "$f" "reports/gambit-$f"; done'
sh 'ls reports'
stash name: 'reports', includes: 'reports/*'
@ -199,8 +199,8 @@ pipeline {
sh 'find . -name "*.o" -delete'
sh 'find . -name "*.o" -delete'
sh 'gosh -r7 -A ./snow r7rs-tests.scm> r7rs-test.log'
sh 'cat r7rs-test.log'
sh 'gosh -r7 -A ./snow r7rs-tests.scm> r7rs-tests.log'
sh 'cat r7rs-tests.log'
sh 'for f in *.log; do cp -- "$f" "reports/gauche-$f"; done'
sh 'ls reports'
stash name: 'reports', includes: 'reports/*'
@ -232,8 +232,8 @@ pipeline {
sh 'find . -name "*.o" -delete'
sh 'find . -name "*.o" -delete'
sh 'guile --fresh-auto-compile --r7rs -L . -L ./snow r7rs-tests.scm> r7rs-test.log'
sh 'cat r7rs-test.log'
sh 'guile --fresh-auto-compile --r7rs -L . -L ./snow r7rs-tests.scm> r7rs-tests.log'
sh 'cat r7rs-tests.log'
sh 'for f in *.log; do cp -- "$f" "reports/guile-$f"; done'
sh 'ls reports'
stash name: 'reports', includes: 'reports/*'
@ -265,8 +265,8 @@ pipeline {
sh 'find . -name "*.o" -delete'
sh 'find . -name "*.o" -delete'
sh 'kawa --r7rs -Dkawa.import.path=./snow/chibi/*.sld:./snow/srfi/*.sld r7rs-tests.scm> r7rs-test.log'
sh 'cat r7rs-test.log'
sh 'kawa --r7rs -Dkawa.import.path=./snow/chibi/*.sld:./snow/srfi/*.sld r7rs-tests.scm> r7rs-tests.log'
sh 'cat r7rs-tests.log'
sh 'for f in *.log; do cp -- "$f" "reports/kawa-$f"; done'
sh 'ls reports'
stash name: 'reports', includes: 'reports/*'
@ -298,8 +298,8 @@ pipeline {
sh 'find . -name "*.o" -delete'
sh 'find . -name "*.o" -delete'
sh ' ls && ls snow/chibi/term/ansi.sld && ls snow/chibi/optional.sld && ls snow/chibi/diff.sld && ls snow/chibi/test.sld'
sh 'LOKO_LIBRARY_PATH=./snow loko -std=r7rs --compile r7rs-tests.scm && ./r7rs-test && rm r7rs-test> r7rs-test.log'
sh 'cat r7rs-test.log'
sh 'LOKO_LIBRARY_PATH=./snow loko -std=r7rs --compile r7rs-tests.scm && ./r7rs-tests && rm r7rs-tests> r7rs-tests.log'
sh 'cat r7rs-tests.log'
sh 'for f in *.log; do cp -- "$f" "reports/loko-$f"; done'
sh 'ls reports'
stash name: 'reports', includes: 'reports/*'
@ -331,8 +331,8 @@ pipeline {
sh 'find . -name "*.o" -delete'
sh 'find . -name "*.o" -delete'
sh 'mit-scheme --load r7rs-tests.scm> r7rs-test.log'
sh 'cat r7rs-test.log'
sh 'mit-scheme --load r7rs-tests.scm> r7rs-tests.log'
sh 'cat r7rs-tests.log'
sh 'for f in *.log; do cp -- "$f" "reports/mit-scheme-$f"; done'
sh 'ls reports'
stash name: 'reports', includes: 'reports/*'
@ -364,8 +364,8 @@ pipeline {
sh 'find . -name "*.o" -delete'
sh 'find . -name "*.o" -delete'
sh 'sash -r7 -L ./snow r7rs-tests.scm > r7rs-test.log && cat r7rs-test.log> r7rs-test.log'
sh 'cat r7rs-test.log'
sh 'sash -r7 -L ./snow r7rs-tests.scm > r7rs-tests.log && cat r7rs-tests.log> r7rs-tests.log'
sh 'cat r7rs-tests.log'
sh 'for f in *.log; do cp -- "$f" "reports/sagittarius-$f"; done'
sh 'ls reports'
stash name: 'reports', includes: 'reports/*'
@ -397,8 +397,8 @@ pipeline {
sh 'find . -name "*.o" -delete'
sh 'find . -name "*.o" -delete'
sh 'stklos -I ./snow r7rs-tests.scm> r7rs-test.log'
sh 'cat r7rs-test.log'
sh 'stklos -I ./snow r7rs-tests.scm> r7rs-tests.log'
sh 'cat r7rs-tests.log'
sh 'for f in *.log; do cp -- "$f" "reports/stklos-$f"; done'
sh 'ls reports'
stash name: 'reports', includes: 'reports/*'
@ -430,8 +430,8 @@ pipeline {
sh 'find . -name "*.o" -delete'
sh 'find . -name "*.o" -delete'
sh 'skint --program r7rs-tests.scm> r7rs-test.log'
sh 'cat r7rs-test.log'
sh 'skint --program r7rs-tests.scm> r7rs-tests.log'
sh 'cat r7rs-tests.log'
sh 'for f in *.log; do cp -- "$f" "reports/skint-$f"; done'
sh 'ls reports'
stash name: 'reports', includes: 'reports/*'
@ -463,8 +463,8 @@ pipeline {
sh 'find . -name "*.o" -delete'
sh 'find . -name "*.o" -delete'
sh 'tr7i r7rs-tests.scm> r7rs-test.log'
sh 'cat r7rs-test.log'
sh 'tr7i r7rs-tests.scm> r7rs-tests.log'
sh 'cat r7rs-tests.log'
sh 'for f in *.log; do cp -- "$f" "reports/tr7-$f"; done'
sh 'ls reports'
stash name: 'reports', includes: 'reports/*'

View File

@ -1,64 +1,64 @@
test-chibi-r7rs-test:
test-chibi-r7rs-tests:
docker run -it -v ${PWD}:/workdir:z schemers/chibi bash -c "cd workdir && chibi-scheme -I ./snow/chibi r7rs-tests.scm"
test-chicken-r7rs-test:
test-chicken-r7rs-tests:
docker run -it -v ${PWD}:/workdir:z schemers/chicken bash -c "cd workdir && ls && cp snow/chibi/term/ansi.sld snow.chibi.term.ansi.sld && csc -include-path ./snow/chibi -include-path ./snow/chibi/term -X r7rs -R r7rs -s -J snow.chibi.term.ansi.sld && cp snow/chibi/optional.sld snow.chibi.optional.sld && csc -include-path ./snow/chibi -include-path ./snow/chibi/term -X r7rs -R r7rs -s -J snow.chibi.optional.sld && cp snow/chibi/diff.sld snow.chibi.diff.sld && csc -include-path ./snow/chibi -include-path ./snow/chibi/term -X r7rs -R r7rs -s -J snow.chibi.diff.sld && cp snow/chibi/test.sld snow.chibi.test.sld && csc -include-path ./snow/chibi -include-path ./snow/chibi/term -X r7rs -R r7rs -s -J snow.chibi.test.sld"
docker run -it -v ${PWD}:/workdir:z schemers/chicken bash -c "cd workdir && csc -include-path ./snow/chibi -X r7rs -R r7rs r7rs-tests.scm && ./r7rs-test && rm r7rs-test"
docker run -it -v ${PWD}:/workdir:z schemers/chicken bash -c "cd workdir && csc -include-path ./snow/chibi -X r7rs -R r7rs r7rs-tests.scm && ./r7rs-tests && rm r7rs-tests"
test-cyclone-r7rs-test:
test-cyclone-r7rs-tests:
docker run -it -v ${PWD}:/workdir:z schemers/cyclone bash -c "cd workdir && ls && cyclone -A . snow/chibi/term/ansi.sld && cyclone -A . snow/chibi/optional.sld && cyclone -A . snow/chibi/diff.sld && cyclone -A . snow/chibi/test.sld"
docker run -it -v ${PWD}:/workdir:z schemers/cyclone bash -c "cd workdir && cyclone -A . r7rs-tests.scm && ./r7rs-test && rm r7rs-test"
docker run -it -v ${PWD}:/workdir:z schemers/cyclone bash -c "cd workdir && cyclone -A . r7rs-tests.scm && ./r7rs-tests && rm r7rs-tests"
test-gambit-r7rs-test:
test-gambit-r7rs-tests:
docker run -it -v ${PWD}:/workdir:z schemers/gambit bash -c "cd workdir && ls && gsc . snow/chibi/term/ansi && gsc . snow/chibi/optional && gsc . snow/chibi/diff && gsc . snow/chibi/test"
docker run -it -v ${PWD}:/workdir:z schemers/gambit bash -c "cd workdir && gsc -exe . -nopreload r7rs-tests.scm && ./r7rs-test && rm r7rs-test"
docker run -it -v ${PWD}:/workdir:z schemers/gambit bash -c "cd workdir && gsc -exe . -nopreload r7rs-tests.scm && ./r7rs-tests && rm r7rs-tests"
test-gauche-r7rs-test:
test-gauche-r7rs-tests:
docker run -it -v ${PWD}:/workdir:z schemers/gauche bash -c "cd workdir && gosh -r7 -A ./snow r7rs-tests.scm"
test-guile-r7rs-test:
test-guile-r7rs-tests:
docker run -it -v ${PWD}:/workdir:z schemers/guile bash -c "cd workdir && guile --fresh-auto-compile --r7rs -L . -L ./snow r7rs-tests.scm"
test-kawa-r7rs-test:
test-kawa-r7rs-tests:
docker run -it -v ${PWD}:/workdir:z schemers/kawa bash -c "cd workdir && kawa --r7rs -Dkawa.import.path=./snow/chibi/*.sld:./snow/srfi/*.sld r7rs-tests.scm"
test-loko-r7rs-test:
test-loko-r7rs-tests:
docker run -it -v ${PWD}:/workdir:z schemers/loko bash -c "cd workdir && ls && ls snow/chibi/term/ansi.sld && ls snow/chibi/optional.sld && ls snow/chibi/diff.sld && ls snow/chibi/test.sld"
docker run -it -v ${PWD}:/workdir:z schemers/loko bash -c "cd workdir && LOKO_LIBRARY_PATH=./snow loko -std=r7rs --compile r7rs-tests.scm && ./r7rs-test && rm r7rs-test"
docker run -it -v ${PWD}:/workdir:z schemers/loko bash -c "cd workdir && LOKO_LIBRARY_PATH=./snow loko -std=r7rs --compile r7rs-tests.scm && ./r7rs-tests && rm r7rs-tests"
test-mit-scheme-r7rs-test:
test-mit-scheme-r7rs-tests:
docker run -it -v ${PWD}:/workdir:z schemers/mit-scheme bash -c "cd workdir && mit-scheme --load r7rs-tests.scm"
test-sagittarius-r7rs-test:
test-sagittarius-r7rs-tests:
docker run -it -v ${PWD}:/workdir:z schemers/sagittarius bash -c "cd workdir && sash -r7 -L ./snow r7rs-tests.scm > r7rs-test.log && cat r7rs-test.log"
docker run -it -v ${PWD}:/workdir:z schemers/sagittarius bash -c "cd workdir && sash -r7 -L ./snow r7rs-tests.scm > r7rs-tests.log && cat r7rs-tests.log"
test-stklos-r7rs-test:
test-stklos-r7rs-tests:
docker run -it -v ${PWD}:/workdir:z schemers/stklos bash -c "cd workdir && stklos -I ./snow r7rs-tests.scm"
test-skint-r7rs-test:
test-skint-r7rs-tests:
docker run -it -v ${PWD}:/workdir:z schemers/skint bash -c "cd workdir && skint --program r7rs-tests.scm"
test-tr7-r7rs-test:
test-tr7-r7rs-tests:
docker run -it -v ${PWD}:/workdir:z schemers/tr7 bash -c "cd workdir && tr7i r7rs-tests.scm"

View File

@ -4,6 +4,7 @@
(scheme char)
(scheme process-context)
(scheme file)
(srfi 13)
(arvyy mustache))
(include "util.scm")
@ -53,37 +54,30 @@
(if (eof-object? line)
results
(read-results (read-line)
(if (string-starts-with? line "# of")
(if (string-contains line " out of ")
(begin
(append results
(list (number-of-line->number line))))
(list line)))
results)))))
(results (if (not (file-exists? logfile))
(list "" "" "" "")
(with-input-from-file
logfile
(lambda ()
(read-results (read-line) (list))))))
(expected-passes (if (> (length results) 0) (list-ref results 0) 0))
(expected-failures (if (> (length results) 1) (list-ref results 1) 0))
(unexpected-failures (if (> (length results) 2) (list-ref results 2) 0))
(skipped-tests (if (> (length results) 3) (list-ref results 3) 0))
(color (cond ((string? expected-passes) "white") ; No logfile
((> unexpected-failures 0) "red")
((> skipped-tests 0) "yellow")
(else "green"))))
(results
(if (file-exists? logfile)
(file-tail logfile 3)
(list)))
(result (apply string-append
(map
(lambda (line)
(string-append line "</br>"))
results))))
(write results)
(newline)
(execute report-row
`((name . ,name)
(command . ,command)
(color . ,color)
(library-command . ,(if (assoc 'library-command implementation)
(cdr (assoc 'library-command implementation))
#f))
(name . ,name)
(expected-passes . ,expected-passes)
(expected-failures . ,expected-failures)
(unexpected-failures . ,unexpected-failures)
(skipped-tests . ,skipped-tests))
(result . ,result))
out)
(newline out)))
implementations)

View File

@ -1,17 +1,3 @@
</table>
<ul>
Numbers
<li># of expected passes</li>
<li># of expected failures</li>
<li># of unexpected failures</li>
<li># of skipped tests</li>
</ul>
<ul>
Colors
<li>Red: # of unexpected failures > 0</li>
<li>Yellow: # of skipped tests > 0</li>
<li>Green: none of the above</li>
</ul>
</body>
</html>

View File

@ -1,6 +1,3 @@
<td style="background-color:{{color}}">
{{expected-passes}}
{{expected-failures}}
{{unexpected-failures}}
{{skipped-tests}}
<td>
{{{result}}}
</td>

View File

@ -1,2 +1,2 @@
(define tests
'(((name . "r7rs-test") (file . "r7rs-tests.scm"))))
'(((name . "r7rs-tests") (file . "r7rs-tests.scm"))))

View File

@ -17,6 +17,20 @@
(and (>= (string-length str) (string-length prefix))
(string=? (string-copy str 0 (string-length prefix)) prefix))))
(define file-tail
(lambda (path linecount)
(with-input-from-file
path
(lambda ()
(letrec
((looper
(lambda (line count lines)
(if (eof-object? line)
(list-tail lines (- (length lines) linecount))
(looper (read-line) (+ count 1) (append lines (list line)))))))
(looper (read-line) 0 (list)))))))
(define number-of-line->number
(lambda (str)
(letrec