1 # This file was written by Yao Qi <qiyao@cn.ibm.com>.
4 set srcfile ${testfile}.c
5 set binfile ${testfile}
8 verbose "compiling source file now....."
9 # Build the shared libraries this test case needs.
10 if { [ ltrace_compile "${srcdir}/${subdir}/${testfile}.c" "${objdir}/${subdir}/${binfile}" executable {debug} ] != "" } {
11 send_user "Testcase compile failed, so all tests in this file will automatically fail\n."
14 # set options for ltrace.
18 set exec_output [ltrace_runtest $objdir/$subdir $objdir/$subdir/$binfile]
20 # Check the output of this program.
21 verbose "ltrace runtest output: $exec_output\n"
22 if [regexp {ELF from incompatible architecture} $exec_output] {
23 fail "32-bit ltrace can not perform on 64-bit PUTs and rebuild ltrace in 64 bit mode!"
25 } elseif [ regexp {Couldn't get .hash data} $exec_output ] {
26 fail "Couldn't get .hash data!"
30 # Extract LOOP from source file.
31 set fd [ open $srcdir/$subdir/$srcfile r]
32 while { [gets $fd line] >= 0 } {
33 regexp {define LOOP.*([0-9]+)} $line match count
37 # Verify the output of ltrace by checking the number of SIGUSR1 in signal.ltrace
39 ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern $count