Blame tests/p_gcc/test_gcc.sh
|
Christoph Galuschka |
94e689 |
#!/bin/sh
|
|
Christoph Galuschka |
94e689 |
# Author: Christoph Galuschka <christoph.galuschka@chello.at>
|
|
Christoph Galuschka |
94e689 |
# Athmane Madjodj <athmanem@gmail.com>
|
|
Christoph Galuschka |
94e689 |
|
|
Karanbir Singh |
106bcf |
t_Log "Running $0 - gcc can build a hello world .c"
|
|
Christoph Galuschka |
94e689 |
|
|
Christoph Galuschka |
94e689 |
# creating source code
|
|
Christoph Galuschka |
94e689 |
FILE='/var/tmp/gcc-test.c'
|
|
Christoph Galuschka |
94e689 |
EXE='/var/tmp/gcc'
|
|
Christoph Galuschka |
94e689 |
|
|
Christoph Galuschka |
94e689 |
cat > $FILE <
|
|
Christoph Galuschka |
94e689 |
#include <stdio.h>
|
|
Christoph Galuschka |
94e689 |
main()
|
|
Christoph Galuschka |
94e689 |
{
|
|
Christoph Galuschka |
94e689 |
printf("hello, centos\n");
|
|
Christoph Galuschka |
94e689 |
}
|
|
Christoph Galuschka |
94e689 |
EOF
|
|
Christoph Galuschka |
94e689 |
|
|
Christoph Galuschka |
94e689 |
# Executing gcc
|
|
Christoph Galuschka |
94e689 |
gcc $FILE -o $EXE
|
|
Christoph Galuschka |
94e689 |
|
|
Christoph Galuschka |
94e689 |
# run EXE
|
|
Christoph Galuschka |
33951f |
$EXE |grep -cq 'hello, centos'
|
|
Christoph Galuschka |
33951f |
t_CheckExitStatus $?
|
|
Christoph Galuschka |
94e689 |
|
|
Christoph Galuschka |
94e689 |
# remove files
|
|
Christoph Galuschka |
94e689 |
/bin/rm $FILE
|
|
Christoph Galuschka |
94e689 |
/bin/rm $EXE
|
|
Christoph Galuschka |
94e689 |
|
|
Christoph Galuschka |
94e689 |
|