summaryrefslogtreecommitdiffhomepage
path: root/integration-tests.sh
blob: 4de10859723334e188f43ed8d429ec2d5f9fc8e2 (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
#!/usr/bin/env bash

case "$(uname -s)" in
    Linux*)
        if [ "$UID" -ne 0 ]; then
            echo "WARNING: Not running as root, some tests may fail" >&2
        fi
        ;;
    MINGW*)
        if ! net session &> /dev/null; then
            echo "WARNING: Not running as administrator, some tests may fail" >&2
        fi
        ;;
    *)
        echo "ERROR: Platform $OSTYPE not supported"
        exit 1
        ;;
esac

MULLVAD_DIR="$(cd "$(dirname "$0")"; pwd -P)"

pushd "$MULLVAD_DIR"

cargo build \
    && cd mullvad-tests \
    && cargo test --features "integration-tests" -- --test-threads=1

RESULT="$?"
popd
exit "$RESULT"