From 478e59a763b494e41e176f6b2a8c12fff730a738 Mon Sep 17 00:00:00 2001 From: Fabian Arrotin Date: Oct 14 2016 11:25:17 +0000 Subject: Merge pull request #20 from DriesVerachtert/master a test for gcc-c++: compile and run a hello world program --- diff --git a/tests/p_gcc-c++/0-install_gcc-c++.sh b/tests/p_gcc-c++/0-install_gcc-c++.sh new file mode 100755 index 0000000..2d62f48 --- /dev/null +++ b/tests/p_gcc-c++/0-install_gcc-c++.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Author: Dries Verachtert + +t_Log "$0 - installing gcc-c++" +t_InstallPackage gcc-c++ diff --git a/tests/p_gcc-c++/1-test_hello_world.sh b/tests/p_gcc-c++/1-test_hello_world.sh new file mode 100755 index 0000000..527cf02 --- /dev/null +++ b/tests/p_gcc-c++/1-test_hello_world.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Author: Dries Verachtert + +t_Log "Running $0 - test gcc-c++ with a hello world program" + +CPPBINARY=`mktemp -q --suffix=.gcc-c++_test` + +cat < +int main(int argc, char** argv) { + std::cout << "Hello world!" << std::endl; +} +EOF + +$CPPBINARY | grep -q "Hello world" +t_CheckExitStatus $? + +rm -f $CPPBINARY