add unit-test-only mode to Dockerfile
authorJacob Lifshay <programmerjake@gmail.com>
Wed, 17 Oct 2018 06:52:43 +0000 (23:52 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Wed, 17 Oct 2018 06:52:43 +0000 (23:52 -0700)
Dockerfile

index bc15bf89782d64e210e92d13ec9a3ad0f2fe4b46..797569a58803445b81787435e0f0386ae3fba7b5 100644 (file)
@@ -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