File: test_mac.sh

package info (click to toggle)
delve 1.24.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,092 kB
  • sloc: ansic: 111,943; sh: 169; asm: 141; makefile: 43; python: 23
file content (52 lines) | stat: -rw-r--r-- 1,077 bytes parent folder | download
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
#!/bin/bash

set -x
set -e

GOVERSION=$1
ARCH=$2
TMPDIR=$3

if [ "$GOVERSION" = "gotip" ]; then
    bootstrapver=$(curl https://go.dev/VERSION?m=text | head -1)
    cd $TMPDIR
    curl -sSL "https://storage.googleapis.com/golang/$bootstrapver.darwin-$ARCH.tar.gz" | tar -xz
    cd -
    if [ -x $TMPDIR/go-tip ]; then
    	cd $TMPDIR/go-tip
    	git pull origin
    else
    	git clone https://go.googlesource.com/go $TMPDIR/go-tip
    fi
    export GOROOT_BOOTSTRAP=$TMPDIR/go
    export GOROOT=$TMPDIR/go-tip
    cd $TMPDIR/go-tip/src
    ./make.bash
    cd -
else
    echo Finding latest patch version for $GOVERSION
    GOVERSION=$(python3 _scripts/latestver.py $GOVERSION)
    echo Go $GOVERSION on $ARCH
    cd $TMPDIR
    curl -sSL "https://storage.googleapis.com/golang/$GOVERSION.darwin-$ARCH.tar.gz" | tar -xz
    cd -
    export GOROOT="$TMPDIR/go"
fi

mkdir -p $TMPDIR/gopath

go env

export GOPATH="$TMPDIR/gopath"
export GOARCH="$ARCH"
export PATH="$GOROOT/bin:$PATH"
go version

set +e
make test
x=$?
if [ "$GOVERSION" = "gotip" ]; then
	exit 0
else
	exit $x
fi