Compare commits
2 Commits
2ee47c348a
...
3c722ac181
| Author | SHA1 | Date |
|---|---|---|
|
|
3c722ac181 | |
|
|
808369f4e5 |
|
|
@ -18,13 +18,11 @@ RUN install compile-r7rs /usr/local/bin/compile-r7rs
|
||||||
|
|
||||||
RUN mkdir -p /root/.snow && echo "()" > /root/.snow/config.scm
|
RUN mkdir -p /root/.snow && echo "()" > /root/.snow/config.scm
|
||||||
|
|
||||||
RUN snow-chibi install --impls=${SCHEME} --skip-tests?=1 --always-yes srfi.64
|
|
||||||
RUN snow-chibi install --impls=${SCHEME} --skip-tests?=1 --always-yes retropikzel.mouth
|
|
||||||
RUN snow-chibi install --impls=${SCHEME} --skip-tests?=1 --always-yes retropikzel.ctrf
|
|
||||||
|
|
||||||
WORKDIR /workdir
|
WORKDIR /workdir
|
||||||
ARG SCHEME=chibi
|
ARG SCHEME=chibi
|
||||||
ENV COMPILE_R7RS=${SCHEME}
|
ENV COMPILE_R7RS=${SCHEME}
|
||||||
|
COPY test-headers.sps .
|
||||||
|
COPY test-headers.scm .
|
||||||
COPY Makefile .
|
COPY Makefile .
|
||||||
COPY retropikzel retropikzel/
|
COPY retropikzel retropikzel/
|
||||||
|
|
||||||
|
|
|
||||||
44
Makefile
44
Makefile
|
|
@ -12,11 +12,20 @@ README=retropikzel/${LIBRARY}/README.html
|
||||||
TESTFILE=retropikzel/${LIBRARY}/test.scm
|
TESTFILE=retropikzel/${LIBRARY}/test.scm
|
||||||
TEST_DEPENDS=srfi.64 retropikzel.mouth retropikzel.ctrf
|
TEST_DEPENDS=srfi.64 retropikzel.mouth retropikzel.ctrf
|
||||||
|
|
||||||
|
SFX=scm
|
||||||
|
SNOW=snow-chibi --impls=${SCHEME} install --skip-tests?=1 --always-yes
|
||||||
|
LIB_PATHS=
|
||||||
|
ifeq "${RNRS}" "r6rs"
|
||||||
|
SNOW=snow-chibi --impls=${SCHEME} install --skip-tests?=1 --always-yes --install-source-dir=. --install-library-dir=.
|
||||||
|
SFX=sps
|
||||||
|
LIB_PATHS=-I .akku/lib
|
||||||
|
endif
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
build: retropikzel/${LIBRARY}/LICENSE retropikzel/${LIBRARY}/VERSION retropikzel/${LIBRARY}/README.md
|
build: retropikzel/${LIBRARY}/LICENSE retropikzel/${LIBRARY}/VERSION retropikzel/${LIBRARY}/README.md
|
||||||
echo "<pre>$$(cat retropikzel/${LIBRARY}/README.md)</pre>" > ${README}
|
echo "<pre>$$(cat retropikzel/${LIBRARY}/README.md)</pre>" > ${README}
|
||||||
snow-chibi package --version=${VERSION} --authors=${AUTHOR} --doc=${README} --description="${DESCRIPTION}" ${LIBRARY_FILE}
|
snow-chibi package --always-yes --version=${VERSION} --authors=${AUTHOR} --doc=${README} --description="${DESCRIPTION}" ${LIBRARY_FILE}
|
||||||
|
|
||||||
index:
|
index:
|
||||||
snow-chibi index ${PKG}
|
snow-chibi index ${PKG}
|
||||||
|
|
@ -27,35 +36,20 @@ install: index
|
||||||
uninstall:
|
uninstall:
|
||||||
snow-chibi remove --impls=${SCHEME} retropikzel.${LIBRARY}
|
snow-chibi remove --impls=${SCHEME} retropikzel.${LIBRARY}
|
||||||
|
|
||||||
test: logs build index
|
logs:
|
||||||
mkdir -p logs
|
mkdir -p logs
|
||||||
# tmpdir
|
|
||||||
|
test: logs build index
|
||||||
|
rm -rf .tmp
|
||||||
mkdir -p .tmp
|
mkdir -p .tmp
|
||||||
# r6rs testfiles
|
cat test-headers.${SFX} ${TESTFILE} | sed 's/LIBRARY/${LIBRARY}/' > .tmp/test.${SFX}
|
||||||
printf "#!r6rs\n(import (rnrs) (srfi :64) (srfi :98) (retropikzel mouth) (retropikzel ctrf) (retropikzel ${LIBRARY}))" > .tmp/test.sps
|
cd .tmp && ${SNOW} ${TEST_DEPENDS} retropikzel.${LIBRARY}
|
||||||
echo "(test-runner-current (ctrf-runner))" >> .tmp/test.sps
|
cd .tmp && akku install akku-r7rs
|
||||||
cat ${TESTFILE} >> .tmp/test.sps
|
cd .tmp && COMPILE_R7RS=${SCHEME} CSC_OPTIONS="-L -lcurl" compile-r7rs ${LIB_PATHS} -o test test.${SFX};
|
||||||
# r7rs testfiles
|
|
||||||
echo "(import (scheme base) (scheme write) (scheme read) (scheme char) (scheme file) (scheme process-context) (retropikzel mouth) (srfi 64) (retropikzel ctrf) (retropikzel ${LIBRARY}))" > .tmp/test.scm
|
|
||||||
echo "(test-runner-current (ctrf-runner))" >> .tmp/test.scm
|
|
||||||
cat ${TESTFILE} >> .tmp/test.scm
|
|
||||||
# r6rs
|
|
||||||
if [ "${RNRS}" = "r6rs" ]; then \
|
|
||||||
cd .tmp \
|
|
||||||
&& snow-chibi install --impls=${SCHEME} --skip-tests?=1 --always-yes --install-source-dir=. --install-library-dir=. ${TEST_DEPENDS} retropikzel.${LIBRARY} \
|
|
||||||
&& akku install akku-r7rs 2> /dev/null \
|
|
||||||
&& COMPILE_R7RS=${SCHEME} compile-r7rs -I .akku/lib -o test test.sps; \
|
|
||||||
fi
|
|
||||||
# r7rs
|
|
||||||
if [ "${RNRS}" = "r7rs" ]; then \
|
|
||||||
cd .tmp \
|
|
||||||
&& snow-chibi install --impls=${SCHEME} retropikzel.${LIBRARY} \
|
|
||||||
&& COMPILE_R7RS=${SCHEME} CSC_OPTIONS="-L -lcurl" compile-r7rs -o test test.scm; \
|
|
||||||
fi
|
|
||||||
cd .tmp && ./test
|
cd .tmp && ./test
|
||||||
mv .tmp/*.json logs/ || true
|
mv .tmp/*.json logs/ || true
|
||||||
|
|
||||||
test-docker:
|
test-docker: logs
|
||||||
docker build --build-arg IMAGE=${IMAGE} --build-arg SCHEME=${SCHEME} -f Dockerfile.test --tag=${SCHEME}-testing .
|
docker build --build-arg IMAGE=${IMAGE} --build-arg SCHEME=${SCHEME} -f Dockerfile.test --tag=${SCHEME}-testing .
|
||||||
docker run -v "${PWD}/logs:/workdir/logs" -w /workdir ${SCHEME}-testing sh -c "make SCHEME=${SCHEME} RNRS=${RNRS} LIBRARY=${LIBRARY} test"
|
docker run -v "${PWD}/logs:/workdir/logs" -w /workdir ${SCHEME}-testing sh -c "make SCHEME=${SCHEME} RNRS=${RNRS} LIBRARY=${LIBRARY} test"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
(import (scheme base)
|
||||||
|
(scheme write)
|
||||||
|
(scheme read)
|
||||||
|
(scheme char)
|
||||||
|
(scheme file)
|
||||||
|
(scheme process-context)
|
||||||
|
(srfi 64)
|
||||||
|
;(retropikzel mouth)
|
||||||
|
;(retropikzel ctrf)
|
||||||
|
(retropikzel LIBRARY))
|
||||||
|
|
||||||
|
;(test-runner-current (ctrf-runner))
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!r6rs
|
||||||
|
(import (except (rnrs) delete-file)
|
||||||
|
(srfi :64)
|
||||||
|
(srfi :98)
|
||||||
|
;(retropikzel mouth)
|
||||||
|
;(retropikzel ctrf)
|
||||||
|
(retropikzel LIBRARY))
|
||||||
|
|
||||||
|
;(test-runner-current (ctrf-runner))
|
||||||
Loading…
Reference in New Issue