From: Jacob Lifshay Date: Wed, 17 Oct 2018 06:52:43 +0000 (-0700) Subject: add unit-test-only mode to Dockerfile X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0719b17c8706d0d4d5e5d3c01e51680b186dbe9f;p=kazan.git add unit-test-only mode to Dockerfile --- diff --git a/Dockerfile b/Dockerfile index bc15bf8..797569a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,20 @@ ENV VULKAN_SDK=/build/vulkansdk/x86_64 ENV PATH="$VULKAN_SDK/bin:$PATH" LD_LIBRARY_PATH="$VULKAN_SDK/lib:" VK_LAYER_PATH="$VULKAN_SDK/etc/explicit_layer.d" WORKDIR /build/kazan COPY run-cts.sh run-cts.sh -RUN ./run-cts.sh --update-only +ARG kazan_test_mode=test +ENV KAZAN_TEST_MODE="${kazan_test_mode}" +RUN if [ "${KAZAN_TEST_MODE}" = "cts" ]; then exec ./run-cts.sh --update-only; fi COPY . . -RUN cargo build -vv -CMD ["./run-cts.sh", "--no-update"] +RUN case "${KAZAN_TEST_MODE}" in \ + cts) \ + exec cargo build -vv; \ + ;; \ + test) \ + exec cargo test --no-fail-fast -vv; \ + ;; \ + *) \ + echo "unknown value of kazan_test_mode; valid values are \"cts\" and \"test\"" >&2; \ + exit 1; \ + ;; \ + esac +CMD if [ "${KAZAN_TEST_MODE}" = "cts" ]; then exec ./run-cts.sh --update-only; else exec bash; fi