bstinson / centos / t_functional

Forked from centos/t_functional 4 years ago
Clone

Blame tests/p_gcc-gnat/test_gcc-gnat.sh

9838c4
#!/bin/sh
9838c4
# Author: Pablo Greco <pablo@fliagreco.com.ar>
9838c4
9838c4
t_Log "Running $0 - gcc-gnat can build a hello.adb"
9838c4
6568fe
if [ "$centos_ver" -lt 7 ] ; then
6568fe
  t_Log "CentOS $centos_ver -> SKIP"
6568fe
  exit 0
6568fe
fi
6568fe
9838c4
# creating source code
9838c4
pushd '/var/tmp' >/dev/null
9838c4
FILE='/var/tmp/gcctesthello.adb'
9838c4
EXE='/var/tmp/gcctesthello'
9838c4
9838c4
cat > $FILE <
9838c4
with Ada.Text_IO;
9838c4
9838c4
procedure GccTestHello is
9838c4
begin
9838c4
  Ada.Text_IO.Put_Line("hello, centos!");
9838c4
end GccTestHello;
9838c4
EOF
9838c4
9838c4
# Executing gcc
9838c4
gnat make -o $EXE $FILE
9838c4
9838c4
# run EXE
9838c4
$EXE |grep -q 'hello, centos'
9838c4
t_CheckExitStatus $?
9838c4
9838c4
# remove files
9838c4
/bin/rm $FILE $EXE $EXE.ali $EXE.o
9838c4
popd >/dev/null