mirror of https://github.com/jenv/jenv.git
4 changed files with 43 additions and 15 deletions
@ -1,7 +1,21 @@
@@ -1,7 +1,21 @@
|
||||
#!/usr/bin/env bash |
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) |
||||
do_test() { |
||||
trap "rm -rf jenv.version *.time shims/ versions/" RETURN INT HUP TERM |
||||
|
||||
docker build --tag jenv:test $SCRIPT_DIR/test |
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) |
||||
|
||||
docker run --mount type=bind,source=$SCRIPT_DIR,target=/root/.jenv jenv:test /root/.jenv/test/bats/bin/bats /root/.jenv/test |
||||
if ! docker build --tag jenv:test "$SCRIPT_DIR/test" |
||||
then |
||||
echo "Failed to build the Docker image." |
||||
return 1 |
||||
fi |
||||
|
||||
if ! docker run --mount type=bind,source="$SCRIPT_DIR",target=/root/.jenv jenv:test /root/.jenv/test/bats/bin/bats /root/.jenv/test |
||||
then |
||||
echo "Tests failed." |
||||
return 1 |
||||
fi |
||||
} |
||||
|
||||
do_test |
||||
|
||||
Loading…
Reference in new issue