diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2023-01-18 13:43:19 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2023-02-20 09:53:09 +0100 |
| commit | 8462e940192c4ab0d016f4f2a149924ee88794b8 (patch) | |
| tree | a332d269b144807887b8a3503f9222cb7838b4f4 /gui/scripts | |
| parent | 5d87248c1c052f6f6f338b60ff3ff284dd617bfd (diff) | |
| download | mullvadvpn-8462e940192c4ab0d016f4f2a149924ee88794b8.tar.xz mullvadvpn-8462e940192c4ab0d016f4f2a149924ee88794b8.zip | |
Add test executable build script to handle target platform
Diffstat (limited to 'gui/scripts')
| -rwxr-xr-x | gui/scripts/build-test-executable.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gui/scripts/build-test-executable.sh b/gui/scripts/build-test-executable.sh new file mode 100755 index 0000000000..a378e65baf --- /dev/null +++ b/gui/scripts/build-test-executable.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +set -eu + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "$SCRIPT_DIR/.." + +TARGET=${1:-$(rustc -vV | sed -n 's|host: ||p')} +PRODUCT_VERSION=$(cargo run -q --bin mullvad-version) + +function build_test_executable { + local pkg_target=$1 + local suffix=${2:-""} + local output="../dist/app-e2e-tests-$PRODUCT_VERSION-$TARGET$suffix" + + npm exec pkg -- \ + --config test.pkg.json \ + --targets "$pkg_target" \ + --output "$output" \ + build/standalone-tests.js +} + +case "$TARGET" in + "aarch64-unknown-linux-gnu") + build_test_executable linux-arm64 + ;; + "x86_64-unknown-linux-gnu") + build_test_executable linux-x64 + ;; + "aarch64-apple-darwin") + build_test_executable macos-arm64 + ;; + "x86_64-apple-darwin") + build_test_executable macos-x64 + ;; + "x86_64-pc-windows-msvc") + build_test_executable win-x64 .exe + ;; +esac |
