Przeglądaj źródła

Closes #594: Add golang hello world test

Marcela Bonell 10 lat temu
rodzic
commit
04afe1c842

+ 1 - 0
test/config.sh

@@ -45,6 +45,7 @@ imageTests+=(
         	gcc-c-hello-world
 	'
 	[golang]='
+	        golang-hello-world
 	'
 	[haskell]='
 		haskell-cabal

+ 1 - 0
test/tests/golang-hello-world/expected-std-out.txt

@@ -0,0 +1 @@
+Hello World!

+ 7 - 0
test/tests/golang-hello-world/hello-world.go

@@ -0,0 +1,7 @@
+package main
+
+import "fmt"
+
+func main() {
+    fmt.Printf("Hello World!")
+}

+ 8 - 0
test/tests/golang-hello-world/run.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+image="$1"
+dirTest="$(dirname "$(readlink -f "$BASH_SOURCE")")"
+dirContainer='/usr/src/hello-world'
+
+docker run --rm -v "$dirTest":"$dirContainer":ro -w "$dirContainer" "$image" sh -c 'go build -o /hello-world hello-world.go && /hello-world'
+