Fixing tests

This commit is contained in:
retropikzel 2025-10-17 07:58:21 +03:00
parent 434a45194f
commit 873264489b
4 changed files with 20 additions and 18 deletions

View File

@ -1,11 +1,18 @@
ARG SCHEME=chibi
ARG IMAGE=${SCHEME}:head
FROM schemers/${IMAGE}
COPY --from=retropikzel1/compile-r7rs /opt/compile-r7rs /opt/compile-r7rs
WORKDIR /build
RUN apt-get update && apt-get install -y gcc make git ca-certificates libffi-dev
RUN git clone https://github.com/ashinn/chibi-scheme.git --depth=1
RUN git clone https://gitea.scheme.org/Retropikzel/compile-r7rs.git --depth=1
WORKDIR /build/chibi-scheme
RUN make && make install
RUN snow-chibi install --always-yes "(foreign c)"
RUN snow-chibi install --always-yes "(srfi 170)"
WORKDIR /build/compile-r7rs
RUN make build-chibi && make install
WORKDIR /workdir
ARG SCHEME=chibi
ENV COMPILE_R7RS=${SCHEME}
ENV PATH=/opt/compile-r7rs/bin:${PATH}
RUN mkdir -p ${HOME}/.snow && echo "()" > ${HOME}/.snow/config.scm
RUN snow-chibi install --always-yes --impls=${SCHEME} "(srfi 64)"

17
Jenkinsfile vendored
View File

@ -2,7 +2,7 @@ pipeline {
agent {
docker {
label 'docker-x86_64'
image 'retropikzel1/compile-r7rs'
image 'debian'
args '--user=root --privileged -v /var/run/docker.socket:/var/run/docker.socket'
}
}
@ -18,18 +18,9 @@ pipeline {
}
stages {
stage('Build compile-r7rs') {
agent {
docker {
image "schemers/chicken:5"
label "docker-x86_64"
}
}
stage('Init') {
steps {
sh "git clone https://gitea.scheme.org/Retropikzel/compile-r7rs.git"
dir("compile-r7rs") {
sh "make build-chicken"
}
sh "apt-get update && apt-get install -y make docker.io git"
}
}
@ -43,7 +34,7 @@ pipeline {
}
stage("${SCHEME}") {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "make SCHEME=${SCHEME} test-in-docker"
sh "make SCHEME=${SCHEME} test-docker"
}
}
}

View File

@ -73,9 +73,13 @@ test: libtest.o libtest.so libtest.a
test-no: package libtest.o libtest.so libtest.a
COMPILE_R7RS=${SCHEME} test-snowball --apt-pkgs "libffi-dev" ${PKG}
test-docker:
test-docker-old:
docker run -it -v "${PWD}:/workdir" -w /workdir retropikzel1/compile-r7rs sh -c \
"make SCHEME=${SCHEME} SNOW_CHIBI_ARGS=--always-yes install test"
"make SCHEME=${SCHEME} SNOW_CHIBI_ARGS=--always-yes build install test"
test-docker:
docker build --build-arg IMAGE=${DOCKERIMG} --build-arg SCHEME=${SCHEME} --tag=retropikzel-foreign-c-test-${SCHEME} -f Dockerfile.test .
docker run -it -v "${PWD}:/workdir" -w /workdir -t retropikzel-foreign-c-test-${SCHEME} sh -c "make SCHEME=${SCHEME} SNOW_CHIBI_ARGS=--always-yes build install test"
libtest.o: tests/c-src/libtest.c
${CC} ${CFLAGS} -o libtest.o -fPIC -c tests/c-src/libtest.c -I./include ${LDFLAGS}