aboutsummaryrefslogtreecommitdiff
blob: 803299fd8768a30c77af56ae7dc6cd504b6f2b90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#! /bin/bash
#
# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org>
# Copyright (c) 2004, Gentoo Foundation
#
# Licensed under the GNU General Public License, v2

. common-functions.sh

tmpfile=$(tempfilename)

test_check() {
	equery check gcc > ${tmpfile}

	x=$(grep "sys-devel/gcc" ${tmpfile} | wc -l)
	
	assert_ge ${FUNCNAME} ${x} 1
	
	x=$(egrep "[0-9]+ out of [0-9]+" ${tmpfile} | wc -l)
	assert_ge ${FUNCNAME} ${x} 1
}

test_check_permissions() {
	equery check sudo > ${tmpfile}

	x=$(grep "app-admin/sudo" ${tmpfile} | wc -l)
	
	assert_ge ${FUNCNAME} ${x} 1
	
	x=$(egrep "[0-9]+ out of [0-9]+" ${tmpfile} | wc -l)
	assert_ge ${FUNCNAME} ${x} 1
}

# Run tests

test_check
test_check_permissions

rm -f ${tmpfile}