#!/usr/bin/env bash # Run the test suite. # # ./test.sh # ./test.sh --no-cache # # Everything runs inside the image's build environment, in the `test` stage, so # the only thing needed on this machine is Docker. That also means the tests see # exactly the JDK, MegaMek jar and shell the build does. # # Nothing is tagged. The stage either succeeds or the build fails. set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # shellcheck source=../versions.env . "$ROOT/versions.env" cd "$ROOT" export DOCKER_BUILDKIT=1 docker build \ --build-arg "JDK_VERSION=$JDK_VERSION" \ --build-arg "JDK_URL_TAG=$JDK_URL_TAG" \ --build-arg "JDK_ARCHIVE=$JDK_ARCHIVE" \ --build-arg "JDK_SHA256=$JDK_SHA256" \ --build-arg "JDK_DIR=$JDK_DIR" \ --build-arg "JRE_MODULES=$JRE_MODULES" \ --build-arg "MEGAMEK_VERSION=$MEGAMEK_VERSION" \ --build-arg "MEGAMEK_RELEASE_DIR=$MEGAMEK_RELEASE_DIR" \ --build-arg "MEGAMEK_SRC_DIR=$MEGAMEK_SRC_DIR" \ --build-arg "MEGAMEK_RELEASE_SHA256=$MEGAMEK_RELEASE_SHA256" \ --build-arg "MEGAMEK_SRC_SHA256=$MEGAMEK_SRC_SHA256" \ --build-arg "SURAMADU_VERSION=$SURAMADU_VERSION" \ --build-arg "SURAMADU_WAR=$SURAMADU_WAR" \ --build-arg "SURAMADU_SHA256=$SURAMADU_SHA256" \ --target test \ --progress plain \ "$@" \ . echo "tests passed"