diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9096932 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM ubuntu AS builder +# suppress input +ARG DEBIAN_FRONTEND=noninteractive + +# essential, cmake, git, boost, GMP for Bignum library +RUN apt-get update && apt-get -y install build-essential cmake git libboost-all-dev libgmp-dev + +# unittest-cpp +RUN git clone https://github.com/unittest-cpp/unittest-cpp.git +WORKDIR /unittest-cpp/builds +RUN cmake ../ +RUN cmake --build ./ +RUN cmake --build ./ --target install + +# libalgebra_tests build +RUN mkdir libalgebra_tests +WORKDIR /libalgebra_tests +COPY . . +WORKDIR /libalgebra_tests/build +ENTRYPOINT cmake -DCMAKE_BUILD_TYPE=Release "$@" .. && cmake --build . + +# Run the tests +FROM builder AS tester +ENTRYPOINT cmake -DCMAKE_BUILD_TYPE=Release "$@" .. && cmake --build . && ./test + +# docker volume create libalgebra_volume +# docker build -t libalgebra . --target builder +# docker run -v libalgebra_volume:/libalgebra_tests/build -it libalgebra +# +# OR +# +# docker volume create libalgebra_tests_volume +# docker build -t libalgebra_tests . --target tester +# docker run -v libalgebra_tests_volume:/libalgebra_tests/build -it libalgebra_tests + diff --git a/README.md b/README.md new file mode 100644 index 0000000..92cd418 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# libalgebra_tests + +A testing suite for the [libalgebra](https://github.com/terrylyons/libalgebra) C++ library. + +### Build tests + +``` +docker build -t libalgebra_tests . +``` + +### Run tests + +``` +docker run -it libalgebra_tests +``` diff --git a/simple-Dockerfile b/simple-Dockerfile new file mode 100644 index 0000000..8936ac5 --- /dev/null +++ b/simple-Dockerfile @@ -0,0 +1,24 @@ +FROM ubuntu +# suppress input +ARG DEBIAN_FRONTEND=noninteractive + +# essential, cmake, git, boost, GMP for Bignum library +RUN apt-get update && apt-get -y install build-essential cmake git libboost-all-dev libgmp-dev + +# unittest-cpp +RUN git clone https://github.com/unittest-cpp/unittest-cpp.git +WORKDIR /unittest-cpp/builds +RUN cmake ../ +RUN cmake --build ./ +RUN cmake --build ./ --target install + +# libalgebra_tests build +RUN mkdir libalgebra_tests +WORKDIR /libalgebra_tests +COPY . . +WORKDIR /libalgebra_tests/build +RUN cmake -DCMAKE_BUILD_TYPE=Release "$@" .. +RUN cmake --build . + +# Run the tests +CMD ./test