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 Binary files /dev/null and b/test/cases/vttest/1_1.sh.png 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