Compare commits

...

27 Commits

Author SHA1 Message Date
retropikzel 75a2d8125b Switch to test-r7rs 2026-03-26 08:53:46 +02:00
retropikzel d13cb8e19b Switch to test-r7rs 2026-03-26 08:34:48 +02:00
retropikzel ba59dc09c4 Switch to test-r7rs 2026-03-26 08:31:47 +02:00
retropikzel 289d34c380 Switch to test-r7rs 2026-03-26 08:29:58 +02:00
retropikzel 9440430a20 Switch to test-r7rs 2026-03-26 08:28:44 +02:00
retropikzel 6a362d5d2f Move to test-r7rs 2026-03-25 14:22:42 +02:00
retropikzel 7a0859a8a7 Move to test-r7rs 2026-03-25 14:19:54 +02:00
retropikzel 22e2ee3da3 Move to test-r7rs 2026-03-25 14:19:23 +02:00
retropikzel fe1cb0804c Improve testing 2026-03-21 13:58:01 +02:00
retropikzel dc97015c31 Fixing testing. Fixing ctrf 2026-03-21 13:23:26 +02:00
retropikzel 529182e547 Fixing testing. Fixing ctrf 2026-03-21 13:08:44 +02:00
retropikzel e6bd287fc8 Fixing testing. Fixing ctrf 2026-03-21 12:21:31 +02:00
retropikzel 3c722ac181 Improving tests 2026-03-14 12:32:36 +02:00
retropikzel 808369f4e5 Improving tests 2026-03-14 12:12:31 +02:00
retropikzel 2ee47c348a Improving tests 2026-03-14 11:49:59 +02:00
retropikzel f5b71f7547 Improving tests 2026-03-14 11:37:50 +02:00
retropikzel 42ab1755e2 Improving tests 2026-03-14 11:33:13 +02:00
retropikzel ab4d6e8a82 Improving tests 2026-03-14 09:33:08 +02:00
retropikzel b0e768b1b6 Improving tests 2026-03-14 09:28:55 +02:00
retropikzel fe45e2340a Improving tests 2026-03-14 09:14:03 +02:00
retropikzel 366444e1e0 Improving tests 2026-03-14 09:12:24 +02:00
retropikzel 71d611c2a5 Fixing testing 2026-03-12 10:52:26 +02:00
retropikzel a4c23cd19d Fixing testing 2026-03-12 10:44:54 +02:00
retropikzel f5892a56b8 Fixing testing 2026-03-12 08:13:07 +02:00
retropikzel 8515c12581 Fixing testing 2026-03-12 08:07:53 +02:00
retropikzel 36dfb46c90 Fixing testing 2026-03-12 08:05:56 +02:00
retropikzel 8d90d2d98f Fixing testing 2026-03-12 08:04:35 +02:00
9 changed files with 67 additions and 131 deletions

View File

@ -1,2 +1,5 @@
FROM debian:trixie-slim
RUN apt-get update && apt-get install -y make docker.io
FROM alpine
RUN apk add make git docker
RUN git clone https://codeberg.org/retropikzel/test-r7rs.git --depth=8 --branch=bugfixes
RUN cd test-r7rs && ./configure && make && make install
COPY --from=schemers/chibi:alpine-head /usr/local /usr/local

View File

@ -1,51 +0,0 @@
ARG SCHEME=chibi
ARG IMAGE=chibi:head
FROM docker.io/debian:trixie AS build
RUN apt-get update && apt-get install -y build-essential git ca-certificates curl xz-utils chicken-bin
RUN chicken-install r7rs
WORKDIR /build
RUN git clone https://github.com/ashinn/chibi-scheme.git --depth=1
RUN curl -O https://gitlab.com/-/project/6808260/uploads/094ce726ce3c6cf8c14560f1e31aaea0/akku-1.1.0.amd64-linux.tar.xz
RUN tar -xf akku*.tar.xz && mv akku-1.1.0.amd64-linux akku
RUN git clone https://codeberg.org/retropikzel/scheme-venv.git --depth=1
RUN git clone https://codeberg.org/retropikzel/compile-scheme.git --depth=1
WORKDIR /build/chibi-scheme
RUN make
RUN make install
WORKDIR /build/compile-scheme
RUN mkdir -p /root/.snow && echo "()" > /root/.snow/config.scm
RUN snow-chibi install --impls=chicken --always-yes retropikzel.system
RUN snow-chibi install --impls=chicken --always-yes srfi.170
RUN make build-chicken
ARG SCHEME=chibi
FROM docker.io/schemers/${IMAGE}
COPY --from=build /build /build
RUN apt-get update && apt-get install -y make curl libcurl4-openssl-dev emscripten
WORKDIR /build/chibi-scheme
RUN make install
WORKDIR /build/akku
RUN bash install.sh
RUN ln -sf /root/.local/bin/akku /usr/local/bin/akku
WORKDIR /build/scheme-venv
RUN make install
WORKDIR /build/compile-scheme
RUN make install
RUN mkdir -p /root/.snow && echo "()" > /root/.snow/config.scm
WORKDIR /workdir
ARG SCHEME=chibi
ENV COMPILE_R7RS=${SCHEME}
RUN snow-chibi install --impls=${SCHEME} --always-yes srfi.64
RUN snow-chibi install --impls=${SCHEME} --always-yes retropikzel.mouth
RUN snow-chibi install --impls=${SCHEME} --always-yes retropikzel.ctrf
COPY Makefile .
COPY retropikzel retropikzel/
RUN make retropikzel/wasm/plus.wasm

22
Jenkinsfile vendored
View File

@ -20,13 +20,6 @@ pipeline {
}
stages {
stage('Cleanup') {
steps {
sh "rm -rf *.json"
}
}
stage('R6RS tests') {
steps {
script {
@ -34,9 +27,8 @@ pipeline {
stage("${LIBRARY}") {
params.R6RS_SCHEMES.split().each { SCHEME ->
stage("${SCHEME}") {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "timeout 600 make SCHEME=${SCHEME} LIBRARY=${LIBRARY} RNRS=r6rs run-test-docker"
archiveArtifacts(artifacts: "${SCHEME}-${LIBRARY}.ctrf.json", allowEmptyArchive: false, fingerprint: true)
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "timeout 6000 make SCHEME=${SCHEME} LIBRARY=${LIBRARY} RNRS=r6rs test-docker"
}
}
}
@ -52,9 +44,8 @@ pipeline {
stage("${LIBRARY}") {
params.R7RS_SCHEMES.split().each { SCHEME ->
stage("${SCHEME}") {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "timeout 600 make SCHEME=${SCHEME} LIBRARY=${LIBRARY} RNRS=r7rs run-test-docker"
archiveArtifacts(artifacts: "${SCHEME}-${LIBRARY}.ctrf.json", allowEmptyArchive: false, fingerprint: true)
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "timeout 6000 make SCHEME=${SCHEME} LIBRARY=${LIBRARY} RNRS=r7rs test-docker"
}
}
}
@ -64,4 +55,9 @@ pipeline {
}
}
}
post {
always {
cleanWs()
}
}
}

View File

@ -3,6 +3,7 @@ RNRS=r7rs
LIBRARY=ctrf
VENV=venv-${SCHEME}-${RNRS}-${LIBRARY}
AUTHOR=retropikzel
PKG=${AUTHOR}-${LIBRARY}-${VERSION}.tgz
LIBRARY_FILE=retropikzel/${LIBRARY}.sld
VERSION=$(shell cat retropikzel/${LIBRARY}/VERSION)
@ -10,79 +11,41 @@ DESCRIPTION=$(shell head -n1 retropikzel/${LIBRARY}/README.md)
README=retropikzel/${LIBRARY}/README.html
TESTFILE=retropikzel/${LIBRARY}/test.scm
PKG=${AUTHOR}-${LIBRARY}-${VERSION}.tgz
MOUTHPKG=${AUTHOR}-mouth-$(shell cat retropikzel/mouth/VERSION).tgz
DOCKERIMG=${SCHEME}:head
ifeq "${SCHEME}" "chicken"
DOCKERIMG="chicken:5"
SFX=scm
SNOW=snow-chibi --impls=${SCHEME} install --always-yes
LIB_PATHS=
ifeq "${RNRS}" "r6rs"
SNOW=snow-chibi --impls=${SCHEME} install --always-yes --install-source-dir=. --install-library-dir=.
SFX=sps
LIB_PATHS=-I .akku/lib
endif
all: build
build: retropikzel/${LIBRARY}/LICENSE retropikzel/${LIBRARY}/VERSION retropikzel/${LIBRARY}/README.md
echo "<pre>$$(cat retropikzel/${LIBRARY}/README.md)</pre>" > ${README}
snow-chibi package --version=${VERSION} --authors=${AUTHOR} --doc=${README} --description="${DESCRIPTION}" ${LIBRARY_FILE}
snow-chibi package --always-yes --version=${VERSION} --authors=${AUTHOR} --doc=${README} --description="${DESCRIPTION}" ${LIBRARY_FILE}
install:
snow-chibi install --impls=${SCHEME} ${SNOW_CHIBI_ARGS} ${PKG}
snow-chibi install --impls=${SCHEME} --always-yes ${PKG}
uninstall:
-snow-chibi remove --impls=${SCHEME} ${PKG}
testfiles: build
rm -rf .tmp
mkdir -p .tmp
cp ${PKG} .tmp/
cp -r retropikzel .tmp/
cat test-headers.${SFX} ${TESTFILE} | sed 's/LIBRARY/${LIBRARY}/' > .tmp/test.${SFX}
logs:
mkdir -p logs
test: testfiles
cd .tmp && COMPILE_R7RS=${SCHEME} CSC_OPIONS="-L -lcurl" compile-r7rs -o test-program -I . test.${SFX}
cd .tmp && ./test-program
snow:
snow-chibi install --impls=generic --skip-tests?=1 --always-yes --install-source-dir=snow --install-library-dir=snow retropikzel.ctrf || true
snow-chibi install --impls=generic --skip-tests?=1 --always-yes --install-source-dir=snow --install-library-dir=snow srfi.64 || true
${VENV}:
scheme-venv ${SCHEME} ${VENV}
if [ "${RNRS}" = "r7rs" ]; then ${VENV}/bin/snow-chibi install --always-yes srfi.64; fi
if [ "${RNRS}" = "r7rs" ]; then ${VENV}/bin/snow-chibi install --always-yes retropikzel.mouth; fi
if [ "${RNRS}" = "r7rs" ]; then ${VENV}/bin/snow-chibi install --always-yes retropikzel.ctrf; fi
if [ "${SCHEME}-${RNRS}" = "mosh-r7rs" ]; then ${VENV}/bin/snow-chibi install --always-yes srfi.64; fi
if [ "${SCHEME}" = "chezscheme" ]; then ${VENV}/bin/akku install akku-r7rs chez-srfi; fi
if [ "${SCHEME}" = "ikarus" ]; then ${VENV}/bin/akku install akku-r7rs chez-srfi; fi
if [ "${SCHEME}" = "ironscheme" ]; then ${VENV}/bin/akku install akku-r7rs chez-srfi; fi
if [ "${SCHEME}" = "racket" ]; then ${VENV}/bin/akku install akku-r7rs chez-srfi; fi
run-test-venv: ${VENV} logs build
echo "(import (scheme base) (scheme write) (scheme read) (scheme char) (scheme file) (scheme process-context) (retropikzel mouth) (srfi 64) (retropikzel ctrf) (retropikzel ${LIBRARY}))" > ${VENV}/test.scm
echo "(test-runner-current (ctrf-runner))" >> ${VENV}/test.scm
printf "#!r6rs\n(import (rnrs) (srfi :64) (srfi :98) (retropikzel mouth) (retropikzel ${LIBRARY}))" > ${VENV}/test.sps
cat ${TESTFILE} >> ${VENV}/test.scm
cat ${TESTFILE} >> ${VENV}/test.sps
if [ "${RNRS}" = "r6rs" ]; then cp -r retropikzel ${VENV}/lib/; fi
if [ "${RNRS}" = "r6rs" ]; then ${VENV}/bin/akku install; fi
if [ "${RNRS}" = "r7rs" ]; then ${VENV}/bin/snow-chibi install ${PKG}; fi
if [ "${RNRS}" = "r6rs" ]; then ${VENV}/bin/scheme-compile ${VENV}/test.sps; fi
if [ "${RNRS}" = "r7rs" ]; then CSC_OPTIONS="-L -lcurl" ${VENV}/bin/scheme-compile ${VENV}/test.scm; fi
cd ${VENV} && ./test
mv ${VENV}/*.json logs/ || true
run-test-system: logs snow build
printf "#!r6rs\n(import (rnrs) (srfi :64) (srfi :98) (retropikzel mouth) (retropikzel ctrf) (retropikzel ${LIBRARY}))" > run-test.sps
echo "(test-runner-current (ctrf-runner))" >> run-test.sps
cat ${TESTFILE} >> run-test.sps
echo "(import (scheme base) (scheme write) (scheme read) (scheme char) (scheme file) (scheme process-context) (retropikzel mouth) (srfi 64) (retropikzel ctrf) (retropikzel ${LIBRARY}))" > run-test.scm
echo "(test-runner-current (ctrf-runner))" >> run-test.scm
cat ${TESTFILE} >> run-test.scm
if [ "${RNRS}" = "r6rs" ]; then akku install akku-r7rs; fi
if [ "${RNRS}" = "r7rs" ]; then snow-chibi install --impls=${SCHEME} --always-yes srfi.64; fi
if [ "${RNRS}" = "r7rs" ]; then snow-chibi install --impls=${SCHEME} --always-yes retropikzel.mouth; fi
if [ "${RNRS}" = "r7rs" ]; then snow-chibi install --impls=${SCHEME} --always-yes retropikzel.ctrf; fi
if [ "${RNRS}" = "r7rs" ]; then snow-chibi install --impls=${SCHEME} ${PKG}; fi
rm -rf run-test
if [ "${RNRS}" = "r6rs" ]; then COMPILE_R7RS=${SCHEME} compile-scheme -I .akku/lib run-test.sps; fi
if [ "${RNRS}" = "r7rs" ]; then COMPILE_R7RS=${SCHEME} CSC_OPTIONS="-L -lcurl" compile-scheme run-test.scm; fi
./run-test
mv *.json logs/ || true
run-test-docker:
docker build --build-arg IMAGE=${DOCKERIMG} -f Dockerfile.test --tag=scheme-libraries-${SCHEME} .
docker run -v "${PWD}/logs:/workdir/logs" -w /workdir scheme-libraries-${SCHEME} sh -c "make SCHEME=${SCHEME} RNRS=${RNRS} LIBRARY=${LIBRARY} run-test-system"
test-docker: testfiles
cd .tmp && SNOW_PACKAGES="srfi.64 srfi.60 srfi.145 srfi.180 retropikzel.mouth" \
APT_PACKAGES="libcurl4-openssl-dev" \
COMPILE_R7RS=${SCHEME} \
CSC_OPIONS="-L -lcurl" \
test-r7rs test.${SFX} ${PKG}
retropikzel/wasm/plus.wasm: retropikzel/wasm/plus.c
emcc -o retropikzel/wasm/plus.js retropikzel/wasm/plus.c

View File

@ -36,7 +36,8 @@
(racket (begin (define implementation-name "racket")))
(sagittarius (begin (define implementation-name "sagittarius")))
(skint (begin (define implementation-name "skint")))
(stklos (begin (define implementation-name "stklos")))
(stklos (begin (define implementation-name "stklos"))
(export ctrf-runner))
(tr7 (begin (define implementation-name "tr7")))
(ypsilon (begin (define implementation-name "ypsilon")))
(else (begin (define implementation-name "unknown"))))

View File

@ -1 +1 @@
1.2.0
1.2.1

View File

@ -4,5 +4,8 @@
(scheme write)
(scheme file))
(export slurp
spit)
spit
;slurb ; TODO Read whole file as bytevector
;sbit ; TODO Write bytevector into file
)
(include "mouth.scm"))

12
test-headers.scm Normal file
View File

@ -0,0 +1,12 @@
(import (scheme base)
(scheme write)
(scheme read)
(scheme char)
(scheme file)
(scheme process-context)
(srfi 64)
;(retropikzel mouth)
;(retropikzel ctrf)
(retropikzel LIBRARY))
;(test-runner-current (ctrf-runner))

9
test-headers.sps Normal file
View File

@ -0,0 +1,9 @@
#!r6rs
(import (except (rnrs) delete-file)
(srfi :64)
(srfi :98)
;(retropikzel mouth)
;(retropikzel ctrf)
(retropikzel LIBRARY))
;(test-runner-current (ctrf-runner))