X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage2%2Ftoolchain-test;h=58eae08a29bd1ac0817691fee1acf6cedf466886;hb=cf3d9a3b194a6578c881cdd4eb528398d4de2741;hp=e169c69955f1e136fe28a5398a6518bbc63b2d8e;hpb=b5bfb2006502b57fab234345a2393fd04e6d55ad;p=hvlinux.git diff --git a/stage2/toolchain-test b/stage2/toolchain-test index e169c69..58eae08 100755 --- a/stage2/toolchain-test +++ b/stage2/toolchain-test @@ -1,21 +1,30 @@ #!/bin/bash -set -o errexit -# Reading system configuration informations, functions and package versions. -source ../sysinfos -source ../functions -source ../packages-list +source ../functions/main -# Testing toolchain +# Testing C compiler cd /tmp echo 'main(){}' > dummy.c gcc dummy.c -Wl,--verbose &> dummy.log -if ! readelf -l a.out | grep 'Requesting program interpreter: /lib/ld-linux.*.so.2' 1> /dev/null 2>&1 ; then +if ! readelf -l a.out | \ + grep -q 'Requesting program interpreter: /lib/ld-linux.*.so.2'; then echo "String 'Requesting program interpreter: /lib/ld-linux.*.so.2' not found" exit 1 fi rm dummy.{c,log} a.out +# Testing C++ compiler +cd /tmp +echo 'main(){}' > dummy.cpp +g++ dummy.cpp -Wl,--verbose &> dummy.log +/tmp/a.out +if [ $? -ne 0]; then + echo "Cannot run C++ program" + exit 1 +fi + +rm dummy.{cpp,log} a.out + exit $?