diff options
Diffstat (limited to 'debian/tests')
-rw-r--r-- | debian/tests/control | 7 | ||||
-rw-r--r-- | debian/tests/hello-world | 20 | ||||
-rw-r--r-- | debian/tests/regression-test | 7 |
3 files changed, 34 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..9bf42b2 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,7 @@ +Tests: hello-world +Depends: @, build-essential +Restrictions: allow-stderr, superficial + +Tests: regression-test +Depends: @, build-essential +Restrictions: allow-stderr diff --git a/debian/tests/hello-world b/debian/tests/hello-world new file mode 100644 index 0000000..1b8be0d --- /dev/null +++ b/debian/tests/hello-world @@ -0,0 +1,20 @@ +#!/bin/sh + +set -ex + +GO="/usr/lib/go-$(dpkg-parsechangelog -SSource | sed 's/golang-//')/bin/go" + +WORKDIR=$(mktemp -d) +trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM +cd $WORKDIR +cat <<EOF > hello.go +package main +import "fmt" +func main() { + fmt.Println("hello world") +} +EOF + +$GO run hello.go +$GO build hello.go +./hello diff --git a/debian/tests/regression-test b/debian/tests/regression-test new file mode 100644 index 0000000..88f203c --- /dev/null +++ b/debian/tests/regression-test @@ -0,0 +1,7 @@ +#!/bin/sh + +set -ex + +GO="/usr/lib/go-$(dpkg-parsechangelog -SSource | sed 's/golang-//')/bin/go" + +$GO test -v cmd/internal/testdir |