Browse Source

Closes #591: Add gcc c hello world test

Marcela Bonell 10 years ago
parent
commit
320e9fcaec

+ 1 - 0
test/config.sh

@@ -42,6 +42,7 @@ imageTests+=(
 	[elasticsearch]='
 	'
 	[gcc]='
+        gcc-c-hello-world
 	'
 	[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;
+}

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

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