Blame src/test/coverageTest.sh

Packit bbb0ff
# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material 
Packit bbb0ff
# is made available to anyone wishing to use, modify, copy, or
Packit bbb0ff
# redistribute it subject to the terms and conditions of the GNU General
Packit bbb0ff
# Public License v.2.
Packit bbb0ff
#
Packit bbb0ff
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
Packit bbb0ff
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
Packit bbb0ff
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
Packit bbb0ff
#
Packit bbb0ff
# You should have received a copy of the GNU General Public License
Packit bbb0ff
# along with this program; if not, write to the Free Software
Packit bbb0ff
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Packit bbb0ff
#
Packit bbb0ff
# Author: Ales Zelinka <azelinka@redhat.com>
Packit bbb0ff
Packit bbb0ff
#tries to find test for every existing rl-function
Packit bbb0ff
test_coverage(){
Packit bbb0ff
	TEST_SCRIPTS=$(ls *Test.sh|grep -v coverageTest.sh)
Packit bbb0ff
	#doesn't work with redirection, must use temp file instead
Packit bbb0ff
	declare -f |grep '^rl.* ()' |grep -v '^rlj'|cut -d ' ' -f 1 >fnc.list
Packit bbb0ff
	while read FUNCTION ; do
Packit bbb0ff
		assertTrue "Test coverage for $FUNCTION" "grep -q $FUNCTION $(echo $TEST_SCRIPTS)"
Packit bbb0ff
	done < fnc.list
Packit bbb0ff
	rm -f fnc.list
Packit bbb0ff
}