34 lines
705 B
Bash
Executable File
34 lines
705 B
Bash
Executable File
#!/bin/sh
|
|
|
|
dirs="src/kernel"
|
|
|
|
main()
|
|
{
|
|
local failures=0
|
|
for dir in $dirs; do
|
|
local files=`find $dir -name "*.tt"`
|
|
for suite in $files; do
|
|
|
|
test_exec="${suite}est"
|
|
compiler_output=`cc -x c $suite -o $test_exec -Wall -Wextra -Werror -I $dir/include -I toolchain -DNDEBUG -DTTEST 2>&1`
|
|
compiler_status=$?
|
|
|
|
if [[ "$compiler_status" -eq "0" ]]; then
|
|
$test_exec $@ || failures=$(($failures + 1))
|
|
else
|
|
failures=$(($failures + 1))
|
|
echo
|
|
echo -e "\x1b[31mCOMPILATION OF SUITE FAILED\x1b[0m"
|
|
echo "$compiler_output" | sed -e 's/\.tt\.c:/\.tt:/'
|
|
fi
|
|
rm -f $test_exec
|
|
done
|
|
done
|
|
|
|
echo
|
|
exit $failures
|
|
|
|
}
|
|
|
|
main "$@"
|