aboutsummaryrefslogtreecommitdiffstats
path: root/mtest.sh
diff options
context:
space:
mode:
authorMichał Łyszczek <michal.lyszczek@bofc.pl>2018-09-03 23:13:41 +0200
committerMichał Łyszczek <michal.lyszczek@bofc.pl>2018-09-03 23:13:41 +0200
commit83f6bd88f12ac589e67a7700a5918627fd7f2f47 (patch)
tree652335ecd26620557eb1a460c3d90a5ad37cb972 /mtest.sh
parentb35a7572291a6062a16cc3a9831d4cc641b09442 (diff)
downloadmtest-83f6bd88f12ac589e67a7700a5918627fd7f2f47.tar.gz
mtest-83f6bd88f12ac589e67a7700a5918627fd7f2f47.tar.bz2
mtest-83f6bd88f12ac589e67a7700a5918627fd7f2f47.zip
add: some statistics at the end of tests
Diffstat (limited to 'mtest.sh')
-rwxr-xr-xmtest.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/mtest.sh b/mtest.sh
index 5af90d9..105df93 100755
--- a/mtest.sh
+++ b/mtest.sh
@@ -5,7 +5,7 @@
# Author: Michał Łyszczek <michal.lyszczek@bofc.pl>
# ==========================================================================
# __________________________________________________________
-# / mtest version v1.1.2 \
+# / mtest version v1.1.3 \
# | |
# | Simple test framework that uses TAP output format |
# \ http://testanything.org /
@@ -42,6 +42,8 @@
mt_test_status=0
mt_total_tests=0
mt_total_failed=0
+mt_total_checks=0
+mt_checks_failed=0
mt_current_test="none"
@@ -120,10 +122,12 @@ mt_run_named()
mt_fail()
{
+ ((mt_total_checks++))
if ! eval $1
then
echo "# assert $mt_current_test, '$1'"
mt_test_status=1
+ ((mt_checks_failed++))
fi
}
@@ -142,6 +146,16 @@ mt_return()
{
echo "1..$mt_total_tests"
+ mt_passed_tests=$((mt_total_tests - mt_total_failed))
+ mt_passed_checks=$((mt_total_checks - mt_checks_failed))
+
+ printf "# total tests.......: %4d\n" ${mt_total_tests}
+ printf "# passed tests......: %4d\n" ${mt_passed_tests}
+ printf "# failed tests......: %4d\n" ${mt_total_failed}
+ printf "# total checks......: %4d\n" ${mt_total_checks}
+ printf "# passed checks.....: %4d\n" ${mt_passed_checks}
+ printf "# failed checks.....: %4d\n" ${mt_checks_failed}
+
if [ $mt_total_failed -gt 254 ]
then
exit 254