From d937f4b365844ec2cc7206c6ef96186d7d6bb0f5 Mon Sep 17 00:00:00 2001 From: Dries Verachtert Date: Oct 13 2016 18:12:49 +0000 Subject: 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