Skip to content
Open
5 changes: 5 additions & 0 deletions ci/teamcity/Delft3D/verschilanalyse/bashunit/.bashunit.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BASHUNIT_SHOW_HEADER=false
BASHUNIT_HEADER_ASCII_ART=false
BASHUNIT_VERBOSE=false
BASHUNIT_SIMPLE_OUTPUT=false
BASHUNIT_SHOW_EXECUTION_TIME=false
20 changes: 20 additions & 0 deletions ci/teamcity/Delft3D/verschilanalyse/bashunit/bash_baton.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

path=$(dirname "$(realpath "$0")")
bash_baton_image="containers.deltares.nl/bashbaton/bashbaton:release_v1.0.0"

container_name="VA-tests"
test_dir="${path}/../bashunit"
bundle_dir="${path}/../bundle"
destination_test_dir="/workspace/bashunit"
destination_bundle_dir="/workspace/bundle"

# Disable Git Bash path rewriting
MSYS_NO_PATHCONV=1 \
docker run \
--rm \
--name "${container_name}" \
--volume "${test_dir}:${destination_test_dir}:ro" \
--volume "${bundle_dir}:${destination_bundle_dir}:ro" \
"${bash_baton_image}" \
"${destination_test_dir}/main.sh"
7 changes: 7 additions & 0 deletions ci/teamcity/Delft3D/verschilanalyse/bashunit/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

ROOT_DIR="$(dirname "$(realpath "$0")")"

export ROOT_DIR
export TEST_DIR="${ROOT_DIR}/tests"
export SRC_DIR="${ROOT_DIR}/src"
12 changes: 12 additions & 0 deletions ci/teamcity/Delft3D/verschilanalyse/bashunit/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# shellcheck disable=SC1091
set -euo pipefail

# Source and set path
path=$(dirname "$(realpath "$0")")
source "${path}/config.sh"

# Run bashunit
echo "Running Unit tests..."
bashunit --env "${ROOT_DIR}/.bashunit.env" ./bashunit/tests/**
echo "All tests completed successfully."
Loading