|
@@ -9,6 +9,14 @@ ALIGN=52
|
|
|
total_tests=0
|
|
total_tests=0
|
|
|
failed_tests=0
|
|
failed_tests=0
|
|
|
|
|
|
|
|
|
|
+function echo_success {
|
|
|
|
|
+ echo -e '\E[27;32m'"\033[1mok\033[0m"
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function echo_failed {
|
|
|
|
|
+ echo -e '\E[27;31m'"\033[1merror\033[0m"
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
# The real tests: compile a file, run it, and compare the output to the
|
|
# The real tests: compile a file, run it, and compare the output to the
|
|
|
# expected output.
|
|
# expected output.
|
|
|
function check_output {
|
|
function check_output {
|
|
@@ -26,9 +34,9 @@ function check_output {
|
|
|
mv tmp.out tmp.res &&
|
|
mv tmp.out tmp.res &&
|
|
|
diff tmp.res $expect_file --side-by-side --ignore-space-change > tmp.out 2>&1
|
|
diff tmp.res $expect_file --side-by-side --ignore-space-change > tmp.out 2>&1
|
|
|
then
|
|
then
|
|
|
- echo success
|
|
|
|
|
|
|
+ echo_success
|
|
|
else
|
|
else
|
|
|
- echo failed
|
|
|
|
|
|
|
+ echo_failed
|
|
|
echo -------------------------------
|
|
echo -------------------------------
|
|
|
cat tmp.out
|
|
cat tmp.out
|
|
|
echo -------------------------------
|
|
echo -------------------------------
|
|
@@ -78,9 +86,9 @@ function check_combined {
|
|
|
mv tmp.out tmp.res &&
|
|
mv tmp.out tmp.res &&
|
|
|
diff tmp.res $expect_file --side-by-side --ignore-space-change > tmp.out 2>&1
|
|
diff tmp.res $expect_file --side-by-side --ignore-space-change > tmp.out 2>&1
|
|
|
then
|
|
then
|
|
|
- echo success
|
|
|
|
|
|
|
+ echo_success
|
|
|
else
|
|
else
|
|
|
- echo failed
|
|
|
|
|
|
|
+ echo_failed
|
|
|
echo -------------------------------
|
|
echo -------------------------------
|
|
|
cat tmp.out
|
|
cat tmp.out
|
|
|
echo -------------------------------
|
|
echo -------------------------------
|
|
@@ -113,11 +121,11 @@ function check_return {
|
|
|
echo failed
|
|
echo failed
|
|
|
failed_tests=$((failed_tests+1))
|
|
failed_tests=$((failed_tests+1))
|
|
|
else
|
|
else
|
|
|
- echo success
|
|
|
|
|
|
|
+ echo_success
|
|
|
fi
|
|
fi
|
|
|
else
|
|
else
|
|
|
if [ $expect_failure -eq 1 ]; then
|
|
if [ $expect_failure -eq 1 ]; then
|
|
|
- echo success
|
|
|
|
|
|
|
+ echo_success
|
|
|
else
|
|
else
|
|
|
echo failed
|
|
echo failed
|
|
|
failed_tests=$((failed_tests+1))
|
|
failed_tests=$((failed_tests+1))
|