File: test_log_output.sh

package info (click to toggle)
check 0.9.8-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 2,724 kB
  • sloc: sh: 10,379; ansic: 5,276; makefile: 358
file content (38 lines) | stat: -rwxr-xr-x 859 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

if [ "${srcdir}" = "." ]; then
    lsrc=""
else
    lsrc="${srcdir}/"
fi

expected="Running suite S1
${lsrc}ex_log_output.c:10:P:Core:test_pass:0: Passed
${lsrc}ex_log_output.c:16:F:Core:test_fail:0: Failure
${lsrc}ex_log_output.c:20:E:Core:test_exit:0: (after this point) Early exit with return value 1
Running suite S2
${lsrc}ex_log_output.c:28:P:Core:test_pass2:0: Passed
Results for all suites run:
50%: Checks: 4, Failures: 1, Errors: 1"


test_log_output ( ) {
    
    ./ex_log_output "${1}" > /dev/null
    actual=`cat test.log`
    if [ x"${expected}" != x"${actual}" ]; then
	echo "Problem with ex_log_output ${3}";
	echo "Expected:";
	echo "${expected}";
	echo "Got:";
	echo "${actual}";
	exit 1;
    fi
    
}

test_log_output "CK_SILENT";
test_log_output "CK_MINIMAL";
test_log_output "CK_NORMAL";
test_log_output "CK_VERBOSE";
exit 0