summaryrefslogtreecommitdiffstats
path: root/kernel/misc/gdb-simple/runtest.sh
blob: ab4854d8992469f378d53626a9d12a7383ce2c5a (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
40
41
42
43
44
45
46
#!/bin/bash

# source the test script helpers
# BUG: This line is intentionally left commented out.
# When I have the helper packages installed the line below should be
# uncommented
 . /usr/bin/rhts-environment.sh

# Commands in this section are provided by test developer.
# ---------------------------------------------

# Assume the test will fail.
result=FAIL

# Helper functions
function result_fail() {
	export result=FAIL
	report_result $TEST $result 0
	exit 0
}
function result_pass () {
	export result=PASS
	report_result $TEST $result 0
	exit 0
}


# run the test. Start gdb against /bin/cat and see if can sucessfully
# attach to it and cat runs to completion.

echo "*** Start of test ***" >> $OUTPUTFILE
gdb /bin/cat -x gdb-commands >> $OUTPUTFILE 2>&1
RC=$?
if [ $RC -eq 0 ] ; then
	echo "*** gdb test successful ***"  >> $OUTPUTFILE
	result_pass
else
	echo "*** gdb test failed ***"  >> $OUTPUTFILE
	result_fail
fi

# something  bad must have happened, otherwise we should not get here.
echo "Unhandled exception or other problem, results not reliable!" >> $OUTPUTFILE
result_fail