diff --git a/Jenkinsfile b/Jenkinsfile index 99ec264..32f3630 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,7 @@ pipeline { parallel implementations.collectEntries { implementation -> [(implementation): { - stage("${implementation} snow-chibi install") { + stage("${implementation} test install") { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { if("${implementation}" == "chicken") { DOCKERIMG="chicken:5" @@ -32,7 +32,7 @@ pipeline { DOCKERIMG="${implementation}:head" } 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 SCHEME=${implementation} clean force-install && cp tests/hello.scm /tmp/ && cd /tmp && SCHEME=${implementation} printf \"\\n\" | timeout 120 compile-r7rs -o hello hello.scm && printf \"\\n\" | timeout 120 ./hello\"" + sh "docker run -v ${WORKSPACE}:/workdir -w /workdir -t foreign-c-test-${implementation} sh -c \"timeout 120 make SCHEME=${implementation} clean force-install && cp tests/hello.scm /tmp/ && cd /tmp && COMPILE_R7RS=${implementation} printf \"\\n\" | timeout 120 compile-r7rs -o hello hello.scm && printf \"\\n\" | timeout 120 ./hello\"" } } tests.each { test -> diff --git a/Makefile b/Makefile index 88e3d8f..707a375 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,6 @@ endif all: build ${TMPDIR} build: README.html - make ${SCHEME} snow-chibi package \ --version=${VERSION} \ --authors="Retropikzel" \ @@ -30,7 +29,9 @@ build: README.html install: if [ "${SCHEME}" = "gauche" ]; then \ - cp -r foreign $(shell gauche-config --sitelibdir)/; \ + cp -r foreign $(shell gauche-config --syslibdir)/; \ + mkdir -p $(shell gauche-config --sysarchdir)/foreign/c/lib; \ + cp -r foreign/c/lib/gauche.so $(shell gauche-config --sysarchdir)/foreign/c/lib/; \ else \ snow-chibi --impls=${SCHEME} install foreign-c-${VERSION}.tgz; \ fi @@ -39,7 +40,11 @@ uninstall: snow-chibi --impls=${SCHEME} remove foreign.c force-install: - printf "\n" | snow-chibi --impls=${SCHEME} --always-yes install foreign-c-${VERSION}.tgz + if [ "${SCHEME}" = "gauche" ]; then \ + cp -r foreign $(shell gauche-config --sitelibdir)/; \ + else \ + printf "\n" | snow-chibi --impls=${SCHEME} --always-yes install foreign-c-${VERSION}.tgz; \ + fi test-java: ${TMPDIR}/test/libtest.o ${TMPDIR}/test/libtest.so ${TMPDIR}/test/libtest.a mkdir -p ${TMPDIR}/test @@ -93,11 +98,13 @@ test-compile-r7rs-wine: test-docker: 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" -test-snow-install-docker: +test-install-docker: docker build --build-arg IMAGE=${DOCKERIMG} --build-arg SCHEME=${SCHEME} --tag=foreign-c-test-${SCHEME} -f dockerfiles/Dockerfile.snow-chibi-install-test . - docker run -it -v "${PWD}:/workdir" -w /workdir -t foreign-c-test-${SCHEME} sh -c "make SCHEME=${SCHEME} TEST=${TEST} all install" + docker run -it -v "${PWD}:/workdir" -w /workdir -t foreign-c-test-${SCHEME} sh \ + -c "make SCHEME=${SCHEME} clean ${SCHEME} install && cp tests/hello.scm /tmp/ && cd /tmp && COMPILE_R7RS=${SCHEME} compile-r7rs -o hello hello.scm && ./hello" ${TMPDIR}/test/libtest.o: tests/c-src/libtest.c mkdir -p ${TMPDIR}/test diff --git a/dockerfiles/Dockerfile.snow-chibi-install-test b/dockerfiles/Dockerfile.snow-chibi-install-test index d9b7008..6c436d1 100644 --- a/dockerfiles/Dockerfile.snow-chibi-install-test +++ b/dockerfiles/Dockerfile.snow-chibi-install-test @@ -6,7 +6,9 @@ RUN apt-get update && apt-get install -y \ git \ make \ libffi-dev \ - pandoc + pandoc \ + tree +RUN mkdir -p ${HOME}/.snow && echo "()" > ${HOME}/.snow/config.scm COPY --from=retropikzel1/compile-r7rs /opt/compile-r7rs /opt/compile-r7rs ENV PATH=/opt/compile-r7rs/bin:${PATH} ARG SCHEME=chibi diff --git a/dockerfiles/Dockerfile.test b/dockerfiles/Dockerfile.test index f737d68..a6af8db 100644 --- a/dockerfiles/Dockerfile.test +++ b/dockerfiles/Dockerfile.test @@ -10,7 +10,8 @@ RUN apt-get update && apt-get install \ make \ libffi-dev \ pandoc \ - libmbedtls-dev + libmbedtls-dev \ + tree RUN mkdir -p ${HOME}/.snow && echo "()" > ${HOME}/.snow/config.scm COPY --from=retropikzel1/compile-r7rs /opt/compile-r7rs /opt/compile-r7rs ENV PATH=/opt/compile-r7rs/bin:${PATH}