Browse Source

Merge pull request #1142 from MBonell/592-test-gcc-cpp-hello-world

Closes #592: Test for gcc cpp image
yosifkit 10 years ago
parent
commit
c208a01bab

+ 1 - 0
test/config.sh

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

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

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

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

@@ -0,0 +1,6 @@
+#include <iostream>
+
+int main() {
+	std::cout << "Hello World!\n";
+	return 0;
+}

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

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