blob: 05d2132679b298e3160778d211d9cfec79deb4ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#!/usr/bin/env bash
set -eu
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
TEST_FRAMEWORK_ROOT="$SCRIPT_DIR/../.."
REPO_DIR="$TEST_FRAMEWORK_ROOT/.."
pushd "$SCRIPT_DIR"
# shellcheck disable=SC1091
source "$REPO_DIR/scripts/utils/log"
case ${1-:""} in
linux)
TARGET=x86_64-unknown-linux-gnu
shift
;;
windows)
TARGET=x86_64-pc-windows-gnu
shift
;;
macos)
# TODO: x86
TARGET=aarch64-apple-darwin
shift
;;
*)
log_error "Invalid platform. Specify a valid platform as first argument"
exit 1
esac
cargo build \
--bin test-runner \
--bin connection-checker \
--release --target "${TARGET}"
# Only build runner image for Windows
if [[ $TARGET == x86_64-pc-windows-gnu ]]; then
TARGET="$TARGET" ./runner-image.sh
fi
popd
while [[ "$#" -gt 0 ]]; do
case $1 in
# Optionally move binaries to some known location
--output)
ARTIFACTS_DIR="$TEST_FRAMEWORK_ROOT/target/$TARGET/release"
mv -t "$1" "$ARTIFACTS_DIR/test-runner" "$ARTIFACTS_DIR/connection-checker"
;;
*)
log_error "Unknown parameter: $1"
exit 1
;;
esac
shift
done
|