Bring things to new compile-r7rs

This commit is contained in:
retropikzel 2025-07-19 18:31:50 +03:00
parent a230385412
commit c31f5323fc
5 changed files with 24 additions and 9 deletions

5
Jenkinsfile vendored
View File

@ -14,19 +14,20 @@ pipeline {
script {
//def implementations = sh(script: 'docker run retropikzel1/compile-r7rs:chibi sh -c "compile-r7rs --list-r7rs-schemes"', returnStdout: true).split()
def implementations = "chibi chicken gauche guile kawa mosh racket sagittarius stklos ypsilon".split()
def DOCKERIMG = sh(script: 'make docker-image', returnStdout: true)
parallel implementations.collectEntries { implementation->
[(implementation): {
stage("${implementation} install") {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "docker build --build-arg SCHEME=${implementation} --tag=foreign-c-test-${implementation} -f dockerfiles/Dockerfile.snow-chibi-install-test ."
sh "docker build --build-arg IMAGE=${DOCKERIMG} --build-arg SCHEME=${implementation} --tag=foreign-c-test-${implementation} -f dockerfiles/Dockerfile.snow-chibi-install-test ."
sh "docker run -v ${WORKSPACE}:/workdir -w /workdir -t foreign-c-test-${implementation} sh -c \"timeout 120 make clean all install-jenkins SCHEME=${implementation} && cp tests/hello.scm /tmp/ && cd /tmp && SCHEME=${implementation} compile-r7rs -o hello hello.scm && timeout 120 ./hello\""
}
}
tests.each { test ->
stage("${implementation} ${test}") {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "docker build --build-arg SCHEME=${implementation} --tag=foreign-c-test-${implementation} -f dockerfiles/Dockerfile.test ."
sh "docker build --build-arg IMAGE=${DOCKERIMG} --build-arg SCHEME=${implementation} --tag=foreign-c-test-${implementation} -f dockerfiles/Dockerfile.test ."
sh "docker run -v ${WORKSPACE}:/workdir -w /workdir -t foreign-c-test-${implementation} sh -c \"timeout 120 make SCHEME=${implementation} TEST=${test} clean test\""
}
}

View File

@ -6,9 +6,16 @@ VERSION=$(shell awk '/version:/{ print $$2 }' README.md )
TEST=primitives
SCHEME=chibi
TMPDIR=tmp/${SCHEME}
DOCKERIMG=${SCHEME}:head
ifeq "${SCHEME}" "chicken"
DOCKERIMG=${SCHEME}
endif
all: build ${TMPDIR}
docker-image:
echo ${DOCKERIMG}
build:
snow-chibi package \
--version=${VERSION} \
@ -79,7 +86,7 @@ test-compile-r7rs-wine:
wine ./${TEST}.bat
test-docker:
docker build --build-arg SCHEME=${SCHEME} --tag=foreign-c-test-${SCHEME} -f dockerfiles/Dockerfile.test .
docker build --build-arg IMAGE=${DOCKERIMG} --build-arg SCHEME=${SCHEME} --tag=foreign-c-test-${SCHEME} -f dockerfiles/Dockerfile.test .
docker run -it -v "${PWD}:/workdir" -w /workdir -t foreign-c-test-${SCHEME} sh -c "make SCHEME=${SCHEME} TEST=${TEST} test"
${TMPDIR}/test/libtest.o: tests/c-src/libtest.c

View File

@ -1,4 +1,5 @@
ARG SCHEME=chibi
ARG IMAGE=chibi:head
FROM schemers/chibi:head AS build
RUN apt-get update && apt-get install -y \
ca-certificates \
@ -11,7 +12,8 @@ RUN git clone https://gitea.scheme.org/Retropikzel/compile-r7rs.git --depth=1
RUN cd compile-r7rs --branch=retropikzel-dependency-fixes && make
ARG SCHEME=chibi
FROM schemers/${SCHEME}:head
ARG IMAGE=chibi:head
FROM schemers/${IMAGE}
RUN apt-get update && apt-get install -y \
build-essential \
git \

View File

@ -1,4 +1,5 @@
ARG SCHEME=chibi
ARG IMAGE=chibi:head
FROM schemers/chibi:head AS build
RUN apt-get update && apt-get install -y \
ca-certificates \
@ -11,7 +12,8 @@ RUN git clone https://gitea.scheme.org/Retropikzel/compile-r7rs.git --depth=1
RUN cd compile-r7rs && make
ARG SCHEME=chibi
FROM schemers/${SCHEME}:head
ARG IMAGE=chibi:head
FROM schemers/${IMAGE}
RUN apt-get update && apt-get install -y \
build-essential \
git \

View File

@ -1,5 +1,6 @@
(import (scheme base)
(scheme write)
(scheme read)
(scheme char)
(scheme file)
(scheme process-context)
@ -324,6 +325,8 @@
(string->c-utf8 "cat2")))
"con2cat2") #t)
(when (file-exists? "testfile.test")
(delete-file "testfile.test"))
(define-c-procedure c-fopen libc 'fopen 'pointer '(pointer pointer))
(define output-file (c-fopen (string->c-utf8 "testfile.test")
(string->c-utf8 "w")))
@ -338,8 +341,8 @@
(debug closed-status)
(assert equal? (= closed-status 0) #t)
(assert equal? (file-exists? "testfile.test") #t)
(assert equal? (string=? (with-input-from-file "testfile.test"
(lambda () (read-line)))
"Hello world 1") #t)
(define file-content (with-input-from-file "testfile.test"
(lambda () (read-line))))
(assert equal? (string=? file-content "Hello world 1") #t)
(exit 0)
(exit)