Skip to content

Commit 816d86f

Browse files
committed
Add golang build test
1 parent 5e87834 commit 816d86f

4 files changed

Lines changed: 63 additions & 0 deletions

File tree

tests/golang-build/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
go1.16.6.tar.gz
2+
go-go1.16.6

tests/golang-build/Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
help:
2+
@echo "Golang build test"
3+
@echo "Available targets:"
4+
@echo " download # download required sources"
5+
@echo " test # run the test"
6+
7+
version = 1.16.6
8+
tarball = go${version}.tar.gz
9+
10+
download: ${tarball}
11+
12+
${tarball}:
13+
wget -O $@.tmp https://github.com/golang/go/archive/refs/tags/${tarball}
14+
mv $@.tmp $@
15+
16+
test: download
17+
@./test.sh
18+
19+
clean:
20+
rm -rf go-go${version}
21+
22+
distclean: clean
23+
rm -f ${tarball}
24+
25+
.PHONY: download test clean distclean help

tests/golang-build/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Golang build test
2+
=================
3+
4+
This just builds go version 1.16.6, and then makes sure we can a basic go
5+
program with the build toolchain.
6+
7+
Building this version of go tests the following kernel fixes:
8+
- `a88603f4b92e ("powerpc/vdso: Don't use r30 to avoid breaking Go lang")`
9+
- `4a5cb51f3db4 ("powerpc/64s/interrupt: Fix check_return_regs_valid() false positive")`

tests/golang-build/test.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
name="golang-build"
6+
echo "test: $name"
7+
8+
rc=0
9+
go version || rc=1
10+
if [[ $rc -ne 0 ]]; then
11+
echo "Error: go missing, install with package manager" >&2
12+
echo "failure: $name"
13+
exit 1
14+
fi
15+
16+
rm -rf go-go1.16.6
17+
tar -xf go1.16.6.tar.gz
18+
cd go-go1.16.6/src
19+
20+
echo "Building ..."
21+
./all.bash
22+
23+
../bin/go run ../test/helloworld.go
24+
25+
echo "success: $name"
26+
27+
exit 0

0 commit comments

Comments
 (0)