Bring things to new compile-r7rs
This commit is contained in:
parent
a230385412
commit
c31f5323fc
|
|
@ -14,19 +14,20 @@ pipeline {
|
||||||
script {
|
script {
|
||||||
//def implementations = sh(script: 'docker run retropikzel1/compile-r7rs:chibi sh -c "compile-r7rs --list-r7rs-schemes"', returnStdout: true).split()
|
//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 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->
|
parallel implementations.collectEntries { implementation->
|
||||||
[(implementation): {
|
[(implementation): {
|
||||||
stage("${implementation} install") {
|
stage("${implementation} install") {
|
||||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
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\""
|
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 ->
|
tests.each { test ->
|
||||||
stage("${implementation} ${test}") {
|
stage("${implementation} ${test}") {
|
||||||
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
|
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\""
|
sh "docker run -v ${WORKSPACE}:/workdir -w /workdir -t foreign-c-test-${implementation} sh -c \"timeout 120 make SCHEME=${implementation} TEST=${test} clean test\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
9
Makefile
9
Makefile
|
|
@ -6,9 +6,16 @@ VERSION=$(shell awk '/version:/{ print $$2 }' README.md )
|
||||||
TEST=primitives
|
TEST=primitives
|
||||||
SCHEME=chibi
|
SCHEME=chibi
|
||||||
TMPDIR=tmp/${SCHEME}
|
TMPDIR=tmp/${SCHEME}
|
||||||
|
DOCKERIMG=${SCHEME}:head
|
||||||
|
ifeq "${SCHEME}" "chicken"
|
||||||
|
DOCKERIMG=${SCHEME}
|
||||||
|
endif
|
||||||
|
|
||||||
all: build ${TMPDIR}
|
all: build ${TMPDIR}
|
||||||
|
|
||||||
|
docker-image:
|
||||||
|
echo ${DOCKERIMG}
|
||||||
|
|
||||||
build:
|
build:
|
||||||
snow-chibi package \
|
snow-chibi package \
|
||||||
--version=${VERSION} \
|
--version=${VERSION} \
|
||||||
|
|
@ -79,7 +86,7 @@ test-compile-r7rs-wine:
|
||||||
wine ./${TEST}.bat
|
wine ./${TEST}.bat
|
||||||
|
|
||||||
test-docker:
|
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"
|
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
|
${TMPDIR}/test/libtest.o: tests/c-src/libtest.c
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
ARG SCHEME=chibi
|
ARG SCHEME=chibi
|
||||||
|
ARG IMAGE=chibi:head
|
||||||
FROM schemers/chibi:head AS build
|
FROM schemers/chibi:head AS build
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
ca-certificates \
|
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
|
RUN cd compile-r7rs --branch=retropikzel-dependency-fixes && make
|
||||||
|
|
||||||
ARG SCHEME=chibi
|
ARG SCHEME=chibi
|
||||||
FROM schemers/${SCHEME}:head
|
ARG IMAGE=chibi:head
|
||||||
|
FROM schemers/${IMAGE}
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
build-essential \
|
build-essential \
|
||||||
git \
|
git \
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
ARG SCHEME=chibi
|
ARG SCHEME=chibi
|
||||||
|
ARG IMAGE=chibi:head
|
||||||
FROM schemers/chibi:head AS build
|
FROM schemers/chibi:head AS build
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
|
|
@ -11,7 +12,8 @@ RUN git clone https://gitea.scheme.org/Retropikzel/compile-r7rs.git --depth=1
|
||||||
RUN cd compile-r7rs && make
|
RUN cd compile-r7rs && make
|
||||||
|
|
||||||
ARG SCHEME=chibi
|
ARG SCHEME=chibi
|
||||||
FROM schemers/${SCHEME}:head
|
ARG IMAGE=chibi:head
|
||||||
|
FROM schemers/${IMAGE}
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
build-essential \
|
build-essential \
|
||||||
git \
|
git \
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
(import (scheme base)
|
(import (scheme base)
|
||||||
(scheme write)
|
(scheme write)
|
||||||
|
(scheme read)
|
||||||
(scheme char)
|
(scheme char)
|
||||||
(scheme file)
|
(scheme file)
|
||||||
(scheme process-context)
|
(scheme process-context)
|
||||||
|
|
@ -324,6 +325,8 @@
|
||||||
(string->c-utf8 "cat2")))
|
(string->c-utf8 "cat2")))
|
||||||
"con2cat2") #t)
|
"con2cat2") #t)
|
||||||
|
|
||||||
|
(when (file-exists? "testfile.test")
|
||||||
|
(delete-file "testfile.test"))
|
||||||
(define-c-procedure c-fopen libc 'fopen 'pointer '(pointer pointer))
|
(define-c-procedure c-fopen libc 'fopen 'pointer '(pointer pointer))
|
||||||
(define output-file (c-fopen (string->c-utf8 "testfile.test")
|
(define output-file (c-fopen (string->c-utf8 "testfile.test")
|
||||||
(string->c-utf8 "w")))
|
(string->c-utf8 "w")))
|
||||||
|
|
@ -338,8 +341,8 @@
|
||||||
(debug closed-status)
|
(debug closed-status)
|
||||||
(assert equal? (= closed-status 0) #t)
|
(assert equal? (= closed-status 0) #t)
|
||||||
(assert equal? (file-exists? "testfile.test") #t)
|
(assert equal? (file-exists? "testfile.test") #t)
|
||||||
(assert equal? (string=? (with-input-from-file "testfile.test"
|
(define file-content (with-input-from-file "testfile.test"
|
||||||
(lambda () (read-line)))
|
(lambda () (read-line))))
|
||||||
"Hello world 1") #t)
|
(assert equal? (string=? file-content "Hello world 1") #t)
|
||||||
|
|
||||||
(exit 0)
|
(exit)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue