summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMitchell Hashimoto <mitchell.hashimoto@gmail.com>2022-07-17 17:11:18 -0700
committerMitchell Hashimoto <mitchell.hashimoto@gmail.com>2022-07-21 09:03:49 -0700
commit70a82458098ac25c0204cc3b2f6560841075ac0e (patch)
treeba4839f053f49c5087f8f85d79049f86637dfa15 /test
parentb04ade67aae22e3b5cf1efdf086db29b14f0607b (diff)
test: run from host
Diffstat (limited to 'test')
-rw-r--r--test/Dockerfile2
-rw-r--r--test/cases/vttest/1_1.sh.pngbin0 -> 14219 bytes
-rwxr-xr-xtest/run-host.sh12
-rwxr-xr-xtest/run.sh5
4 files changed, 18 insertions, 1 deletions
diff --git a/test/Dockerfile b/test/Dockerfile
index 19b7c7153..12ea74da5 100644
--- a/test/Dockerfile
+++ b/test/Dockerfile
@@ -42,4 +42,4 @@ COPY --from=vttest /vttest /usr/bin/vttest
COPY ./run.sh /entrypoint.sh
-ENTRYPOINT ["/entrypoint.sh"]
+ENTRYPOINT ["/bin/bash"]
diff --git a/test/cases/vttest/1_1.sh.png b/test/cases/vttest/1_1.sh.png
new file mode 100644
index 000000000..ba1bc593d
--- /dev/null
+++ b/test/cases/vttest/1_1.sh.png
Binary files differ
diff --git a/test/run-host.sh b/test/run-host.sh
new file mode 100755
index 000000000..7538c237c
--- /dev/null
+++ b/test/run-host.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+#
+# This runs a single test case from the host (not from Docker itself). The
+# arguments are the same as run.sh but this wraps it in docker.
+
+docker run \
+ --init \
+ --rm \
+ -v $(pwd):/src \
+ --entrypoint "xvfb-run" \
+ $(docker build -q .) \
+ /entrypoint.sh $@
diff --git a/test/run.sh b/test/run.sh
index 95620f19b..fdfc73768 100755
--- a/test/run.sh
+++ b/test/run.sh
@@ -19,16 +19,21 @@ function has_func() {
#--------------------------------------------------------------------
# Flag parsing
+ARG_UPDATE=0
while [[ "$#" -gt 0 ]]; do
case $1 in
-e|--exec) ARG_EXEC="$2"; shift ;;
-c|--case) ARG_CASE="$2"; shift ;;
-o|--output) ARG_OUT="$2"; shift ;;
+ -u|--update) ARG_UPDATE=1 ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done
+# If we're updating, then just update the file in-place
+if [ "$ARG_UPDATE" -eq 1 ]; then ARG_OUT="${ARG_CASE}.png"; fi
+
bad=0
if [ -z "$ARG_EXEC" ]; then bad=1; fi
if [ -z "$ARG_CASE" ]; then bad=1; fi