PlainOsBuilder/tests/c.sh

21 lines
305 B
Bash
Executable File

#!/bin/sh
out_name=$(mktemp XXXXXX)
echo "#include <stdio.h>" >> test.c
echo "int main(void){return 0;}" >> test.c
$CC test.c -o $out_name
rm test.c
if ./$out_name; then
echo "[OK] C compiler work..."
rm $out_name
exit 0
else
echo "[FAILED] Fix c compiler or headers..."
rm $out_name
exit 1
fi