diff --git a/tests/Makefile.am b/tests/Makefile.am
index 288c9bb57fc0e271c11bf00717d3f32d746796f8..7fe5157f36145272aa26efe18c7d24fd2e8fb119 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -869,11 +869,9 @@ $(TEXTOUT): $(TARGETS)
 
 check-matlab: $(M_XFAIL_TRS_FILES) $(M_TRS_FILES)
 	./read_trs_files.sh "$(M_TRS_FILES)" "$(M_XFAIL_TRS_FILES)"
-	@echo 'Matlab Tests Done'
 
 check-octave: $(O_XFAIL_TRS_FILES) $(O_TRS_FILES)
 	./read_trs_files.sh "$(O_TRS_FILES)" "$(O_XFAIL_TRS_FILES)"
-	@echo 'Octave Tests Done'
 
 %.m.trs %.m.log: %.mod
 	@echo "`tput bold``tput setaf 8`MATLAB: $(PWD)/$*... `tput sgr0`"
diff --git a/tests/read_trs_files.sh b/tests/read_trs_files.sh
index de53c43ac0a95a7f8ef9c859a688e9af15295268..e0e9a06d1089f892f9def7d516dde36988fce540 100755
--- a/tests/read_trs_files.sh
+++ b/tests/read_trs_files.sh
@@ -89,3 +89,6 @@ fi
     echo "$timing" | tr ':' '\n' | sed -e 's/^[ \t]*//;/^$/d;s/^|[ ]/|     * /'
     echo
 } > $outfile
+
+# Exit with error code if some tests failed
+((failed + xpassed == 0))