浏览代码

Merge pull request #1112 from MBonell/591-test-gcc-hello-world

Closes #591: Test for GCC image
Tianon Gravi 10 年之前
父节点
当前提交
d0be227411

+ 1 - 0
test/config.sh

@@ -42,6 +42,7 @@ imageTests+=(
 	[elasticsearch]='
 	[elasticsearch]='
 	'
 	'
 	[gcc]='
 	[gcc]='
+        	gcc-c-hello-world
 	'
 	'
 	[golang]='
 	[golang]='
 	'
 	'

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

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

+ 6 - 0
test/tests/gcc-c-hello-world/hello-world.c

@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+int main(){
+    printf("Hello World!");
+    return 0;
+}

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

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