Skip to content

Commit

Permalink
[5-PITIX] Add score information in checker
Browse files Browse the repository at this point in the history
For 5-pitix assignment there is no info about score or the number of test passed (at least a counter). Simple searching for "failed" in output is error prone (and painfully hard for the average Joe).

A simple solution is to add a test_ok var to count the number of passed test. Better solutions exist, but keep it simple stupid as fellow student only care about the number of tests passed to know the homework is okay.
  • Loading branch information
nitu-catalin1998 authored and claudiughioc committed May 7, 2020
1 parent c0fbbb9 commit f653460
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/labs/templates/assignments/5-pitix/checker/_checker
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mkfs_cmd=./mkfs.pitix
inode_direct_data_blocks=5
inode_size=32

test_ok=0
test_no=0

#
Expand Down Expand Up @@ -64,6 +65,7 @@ check_true()
extra_string="$@"
ret=1
else
test_ok=$(($test_ok+1))
extra_string=""
end_string="ok"
ret=0
Expand All @@ -88,6 +90,7 @@ check_false()
end_string="failed"
extra_string="$@"
else
test_ok=$(($test_ok+1))
end_string="ok"
extra_string=""
fi
Expand Down Expand Up @@ -375,4 +378,6 @@ check_true "module unloading" rmmod pitix

cleanup_world

echo "Tests ok: $test_ok/$test_no" # could also display as percent

# vim: set tabstop=4 shiftwidth=4:

0 comments on commit f653460

Please sign in to comment.