blob: bda036f5256f464ce561fc31c34c2b5ac52343f4 (
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
|
# This file was written by Yao Qi <qiyao@cn.ibm.com>.
set testfile "trace-clone"
set srcfile ${testfile}.c
set binfile ${testfile}
verbose "compiling source file now....."
# Build the shared libraries this test case needs.
if { [ ltrace_compile "${srcdir}/${subdir}/${testfile}.c" "${srcdir}/${subdir}/${binfile}" executable {debug} ] != "" } {
send_user "Testcase compile failed, so all tests in this file will automatically fail.\n"
}
global LTRACE
#Run PUT for ltrace.
spawn $LTRACE -f $srcdir/$subdir/$binfile
set timeout 4
expect timeout {
fail "Time out! Maybe caused by ltrace segment fault or improper timeout value here!"
return
}
catch "exec $LTRACE -f $srcdir/$subdir/$binfile" exec_output
# Save the output
ltrace_saveoutput "${exec_output}" ${srcdir}/${subdir}/${testfile}.ltrace
#check the output of this program.
verbose "ltrace runtest output: $exec_output\n"
if [regexp {ELF from incompatible architecture} $exec_output] {
fail "32-bit ltrace can not perform on 64-bit PUTs and rebuild ltrace in 64 bit mode!"
return
} elseif [ regexp {Operation not permitted} $exec_output ] {
fail "Operation not permitted, see testrun.log for details!"
return
} elseif [ regexp {killed by SIGKILL} $exec_output ] {
fail "killed by SIGKILL!"
return
}
set pattern "clone"
ltrace_verify_output ${srcdir}/${subdir}/${testfile}.ltrace $pattern 1
|