Adding more Jenkins tests

This commit is contained in:
retropikzel 2025-06-25 06:18:28 +03:00
parent 0af0378c0e
commit 1752e4a8fc
7 changed files with 103 additions and 36 deletions

8
Jenkinsfile vendored
View File

@ -18,11 +18,17 @@ pipeline {
tests.each { test ->
stage("${implementation} ${test}") {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "docker build --build-arg COMPILE_R7RS=${implementation} --tag=r7rs-pffi-test-${implementation} -f Dockerfile.test ."
sh "docker build --build-arg COMPILE_R7RS=${implementation} --tag=r7rs-pffi-test-${implementation} -f dockerfiles/Dockerfile.test ."
sh "docker run -v ${WORKSPACE}:/workdir -w /workdir -t r7rs-pffi-test-${implementation} sh -c \"make COMPILE_R7RS=${implementation} TESTNAME=primitives test-compile-r7rs\""
}
}
}
stage("${implementation} snow-chibi install test") {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "docker build --build-arg COMPILE_R7RS=${implementation} --tag=r7rs-pffi-test-${implementation} -f dockerfiles/Dockerfile.snow-chibi-install-test ."
sh "docker run -v ${WORKSPACE}:/workdir -w /workdir -t r7rs-pffi-test-${implementation} sh -c \"make clean-package package && snow-chibi install --impls=foreign-c-0.10.0.tgz && ${implementation} tests/hello.scm\""
}
}
}
}
}

View File

@ -21,6 +21,7 @@ package:
--version=${VERSION} \
--authors="Retropikzel" \
--doc=README.html \
--foreign-depends=ffi \
--description="Portable foreign function interface for R7RS Schemes" \
foreign/c.sld
@ -89,6 +90,69 @@ docs:
-o documentation/foreign-c.pdf \
README.md
chibi: foreign/c/primitives/chibi/foreign-c.stub
chibi-ffi foreign/c/primitives/chibi/foreign-c.stub
${CC} \
-g3 \
-o foreign/c/primitives/chibi/foreign-c.so \
foreign/c/primitives/chibi/foreign-c.c \
-fPIC \
-lffi \
-shared
chicken:
@echo "Nothing to build for Chicken"
cyclone:
@echo "Nothing to build for Cyclone"
gambit:
@echo "Nothing to build for Gambit"
gauche: primitives/gauche/foreign-c-primitives-gauche.c primitives/gauche/gauchelib.scm
gauche-package compile \
--srcdir=primitives/gauche \
--cc=${CC} \
--cflags="-I./primitives/include" \
--libs=-lffi \
foreign-c-primitives-gauche foreign-c-primitives-gauche.c gauchelib.scm
mkdir -p lib
mv foreign-c-primitives-gauche.so lib/gauche.so
mv foreign-c-primitives-gauche.o lib/gauche.o
gerbil:
@echo "Nothing to build for Gerbil"
guile:
@echo "Nothing to build for Guile"
kawa:
@echo "Nothing to build for Kawa"
larceny:
@echo "Nothing to build for Larceny"
mosh:
@echo "Nothing to build for Mosh"
racket:
@echo "Nothing to build for Racket"
sagittarius:
@echo "Nothing to build for Sagittarius"
skint:
@echo "Nothing to build for Skint"
stklos:
@echo "Nothing to build for Stklos"
tr7:
@echo "Nothing to build for tr7"
ypsilon:
@echo "Nothing to build for Ypsilon"
clean:
find . -name "*.meta" -delete
find . -name "*.link" -delete
@ -100,3 +164,4 @@ clean:
find . -name "core.1" -delete
find . -name "*@gambit*" -delete
rm -rf tmp
rm foreign/c/primitives/chibi/foreign-c.c

View File

@ -0,0 +1,24 @@
ARG COMPILE_R7RS=chibi
FROM debian:bookworm AS build
RUN apt-get update && apt-get install -y wget build-essential make git
RUN git clone https://github.com/Retropikzel/chibi-scheme.git --branch=snow-chibi-foreign-depends
RUN cd chibi-scheme && make PREFIX=/usr/local-other && make PREFIX=/usr/local-other install
FROM schemers/${COMPILE_R7RS}
RUN apt-get update && apt-get install -y \
build-essential \
git \
make \
libffi8 \
libgc1 \
libssl3 \
libuv1 \
build-essential \
libffi-dev \
libmbedtls-dev
COPY --from=build /usr/local-other /usr/local-other
RUN rm -rf /usr/local/bin/snow-chibi
ENV PATH=${PATH}:/usr/local-other/bin
RUN git clone https://gitea.scheme.org/Retropikzel/compile-r7rs.git --depth=1
RUN cd compile-r7rs && make && make install

View File

@ -1,13 +1,10 @@
(cond-expand
(windows (define-c-library libc
'("stdio.h" "string.h")
"ucrtbase"
'((additional-versions ("0" "6")))))
(windows (define-c-library libc '("stdio.h" "string.h") "ucrtbase" '()))
(else
(define c-library "c")
(when (get-environment-variable "BE_HOST_CPU")
;(define c-library "c")
#;(when (get-environment-variable "BE_HOST_CPU")
(set! c-library "root"))
(define-c-library libc
'("stdio.h" "string.h")
c-library
'((additional-versions ("" "0" "6" "7"))))))
"c"
'((additional-versions ("0" "6"))))))

View File

@ -2,31 +2,6 @@
(scheme write)
(foreign c))
(cond-expand
(windows (define-c-library c-stdlib
'("stdlib.h")
"ucrtbase"
'()))
(else (define-c-library c-stdlib
'("stdlib.h")
"c"
'((additional-versions ("6"))))))
(define-c-procedure c-system c-stdlib 'system 'int '(pointer))
(define (anything->string item)
(parameterize
((current-output-port (open-output-string)))
(display item)
(get-output-string (current-output-port))))
(define (system command)
(c-system (string->c-utf8
(apply string-append
(map (lambda (item)
(string-append (anything->string item) " "))
command)))))
(system '(ls))
(define-c-procedure c-puts libc 'puts 'int '(pointer))
(c-puts "Hello from C!")