Fixing tests
This commit is contained in:
parent
0758aa5c84
commit
3f8f06f1e2
|
@ -13,3 +13,4 @@ test
|
||||||
README.html
|
README.html
|
||||||
*.import.*
|
*.import.*
|
||||||
deps
|
deps
|
||||||
|
tmp
|
||||||
|
|
|
@ -9,3 +9,4 @@ COPY compile-r7rs.scm .
|
||||||
COPY libs/ libs/
|
COPY libs/ libs/
|
||||||
RUN make && make install
|
RUN make && make install
|
||||||
WORKDIR /workdir
|
WORKDIR /workdir
|
||||||
|
RUN mkdir -p ${HOME}/.snow && echo "()" > ${HOME}/.snow/config.scm
|
||||||
|
|
|
@ -9,3 +9,4 @@ COPY compile-r7rs.scm .
|
||||||
COPY libs/ libs/
|
COPY libs/ libs/
|
||||||
RUN make && make install
|
RUN make && make install
|
||||||
WORKDIR /workdir
|
WORKDIR /workdir
|
||||||
|
RUN mkdir -p ${HOME}/.snow && echo "()" > ${HOME}/.snow/config.scm
|
||||||
|
|
|
@ -11,3 +11,4 @@ ARG SCHEME=chibi
|
||||||
ENV COMPILE_R7RS=${SCHEME}
|
ENV COMPILE_R7RS=${SCHEME}
|
||||||
RUN git clone https://github.com/ashinn/chibi-scheme.git --depth=1 \
|
RUN git clone https://github.com/ashinn/chibi-scheme.git --depth=1 \
|
||||||
&& cd chibi-scheme && make -j 16 && make -j 16 install
|
&& cd chibi-scheme && make -j 16 && make -j 16 install
|
||||||
|
RUN mkdir -p ${HOME}/.snow && echo "()" > ${HOME}/.snow/config.scm
|
||||||
|
|
20
Makefile
20
Makefile
|
@ -29,35 +29,36 @@ uninstall:
|
||||||
rm -rf ${PREFIX}/lib/compile-r7rs
|
rm -rf ${PREFIX}/lib/compile-r7rs
|
||||||
rm -rf ${PREFIX}/bin/compile-r7rs
|
rm -rf ${PREFIX}/bin/compile-r7rs
|
||||||
|
|
||||||
test-r6rs: ${R6RSTMP}
|
test-r6rs:
|
||||||
|
rm -rf ${R6RSTMP}
|
||||||
mkdir -p ${R6RSTMP}
|
mkdir -p ${R6RSTMP}
|
||||||
mkdir -p ${R6RSTMP}/libs
|
mkdir -p ${R6RSTMP}/libs
|
||||||
|
mkdir -p ${R6RSTMP}/libs/foo
|
||||||
printf "(library (foo bar) (export baz) (import (rnrs)) (define baz (lambda () (display \"Test successfull\") (newline))))" > ${R6RSTMP}/libs/foo/bar.sls
|
printf "(library (foo bar) (export baz) (import (rnrs)) (define baz (lambda () (display \"Test successfull\") (newline))))" > ${R6RSTMP}/libs/foo/bar.sls
|
||||||
printf "(import (rnrs) (foo bar)) (baz)" > ${R6RSTMP}/main.sps
|
printf "(import (rnrs) (foo bar)) (baz)" > ${R6RSTMP}/main.sps
|
||||||
cd ${R6RSTMP} && COMPILE_R7RS=${SCHEME} compile-r7rs -I ./libs -o main main.sps
|
cd ${R6RSTMP} && COMPILE_R7RS=${SCHEME} compile-r7rs -I ./libs -o main main.sps
|
||||||
-cd ${R6RSTMP} && timeout 60 ./main > ${R6RSTMP}/compile-r7rs-test-result.txt 2>&1
|
-cd ${R6RSTMP} && timeout 60 ./main > compile-r7rs-test-result.txt 2>&1
|
||||||
@grep "Test successfull" ${R6RSTMP}/compile-r7rs-test-result.txt || (echo "Test failed, output: " && cat ${R6RSTMP}/compile-r7rs-test-result.txt && exit 1)
|
@grep "Test successfull" ${R6RSTMP}/compile-r7rs-test-result.txt || (echo "Test failed, output: " && cat ${R6RSTMP}/compile-r7rs-test-result.txt && exit 1)
|
||||||
|
|
||||||
test-r6rs-docker:
|
test-r6rs-docker:
|
||||||
docker build -f Dockerfile.test --build-arg SCHEME=${SCHEME} --tag=compile-r7rs-test-${SCHEME} .
|
docker build -f Dockerfile.test --build-arg SCHEME=${SCHEME} --tag=compile-r7rs-test-${SCHEME} .
|
||||||
docker run -v "${PWD}":/workdir -w /workdir -t compile-r7rs-test-${SCHEME} sh -c "make && make install && make clean-test SCHEME=${SCHEME} test-r6rs"
|
docker run -v "${PWD}":/workdir -w /workdir -t compile-r7rs-test-${SCHEME} sh -c "make && make install && make SCHEME=${SCHEME} test-r6rs"
|
||||||
|
|
||||||
test-r7rs:
|
test-r7rs:
|
||||||
|
rm -rf ${R7RSTMP}
|
||||||
mkdir -p ${R7RSTMP}
|
mkdir -p ${R7RSTMP}
|
||||||
mkdir -p ${R7RSTMP}/libs
|
mkdir -p ${R7RSTMP}/libs
|
||||||
|
mkdir -p ${R7RSTMP}/libs/foo
|
||||||
echo "(import (scheme base) (foo bar)) (baz)" > ${R7RSTMP}/main.scm
|
echo "(import (scheme base) (foo bar)) (baz)" > ${R7RSTMP}/main.scm
|
||||||
echo "(define baz (lambda () (display \"Test successfull\") (newline)))" > ${R7RSTMP}/libs/foo/bar.scm
|
echo "(define baz (lambda () (display \"Test successfull\") (newline)))" > ${R7RSTMP}/libs/foo/bar.scm
|
||||||
echo "(define-library (foo bar) (import (scheme base) (scheme write)) (export baz) (include \"bar.scm\"))" > ${R7RSTMP}/libs/foo/bar.sld
|
echo "(define-library (foo bar) (import (scheme base) (scheme write)) (export baz) (include \"bar.scm\"))" > ${R7RSTMP}/libs/foo/bar.sld
|
||||||
cd ${R7RSTMP} && COMPILE_R7RS=${SCHEME} compile-r7rs -I ./snow -o main main.scm
|
cd ${R7RSTMP} && COMPILE_R7RS=${SCHEME} compile-r7rs -I ./libs -o main main.scm
|
||||||
-cd ${R7RSTMP} && timeout 60 ./main > ${R7RSTMP}/compile-r7rs-test-result.txt 2>&1
|
-cd ${R7RSTMP} && ./main > compile-r7rs-test-result.txt 2>&1
|
||||||
@grep "Test successfull" ${R7RSTMP}/compile-r7rs-test-result.txt || (echo "Test failed, output: " && cat ${R7RSTMP}/compile-r7rs-test-result.txt && exit 1)
|
@grep "Test successfull" ${R7RSTMP}/compile-r7rs-test-result.txt || (echo "Test failed, output: " && cat ${R7RSTMP}/compile-r7rs-test-result.txt && exit 1)
|
||||||
|
|
||||||
test-r7rs-docker:
|
test-r7rs-docker:
|
||||||
docker build -f Dockerfile.test --build-arg SCHEME=${SCHEME} --tag=compile-r7rs-test-${SCHEME} .
|
docker build -f Dockerfile.test --build-arg SCHEME=${SCHEME} --tag=compile-r7rs-test-${SCHEME} .
|
||||||
docker run -v "${PWD}":/workdir -w /workdir -t compile-r7rs-test-${SCHEME} sh -c "make && make install && make clean-test SCHEME=${SCHEME} test-r7rs"
|
docker run -v "${PWD}":/workdir -w /workdir -t compile-r7rs-test-${SCHEME} sh -c "make && make install && make SCHEME=${SCHEME} test-r7rs"
|
||||||
|
|
||||||
clean-test:
|
|
||||||
rm -rf test
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
find . -name "*.so" -delete
|
find . -name "*.so" -delete
|
||||||
|
@ -68,7 +69,6 @@ clean:
|
||||||
find . -name "*.meta" -delete
|
find . -name "*.meta" -delete
|
||||||
find . -name "*.import.*" -delete
|
find . -name "*.import.*" -delete
|
||||||
rm -rf dist
|
rm -rf dist
|
||||||
rm -rf test
|
|
||||||
rm -rf deps
|
rm -rf deps
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue