1 # This file was written by Yao Qi <qiyao (at) cn.ibm.com>. 2 3 set testfile "trace-clone" 4 set srcfile ${testfile}.c 5 set binfile ${testfile} 6 7 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" 12 } 13 14 ltrace_options "-f" 15 set exec_output [ltrace_runtest $objdir/$subdir $objdir/$subdir/$binfile] 16 17 #check the output of this program. 18 verbose "ltrace runtest output: $exec_output\n" 19 if [regexp {ELF from incompatible architecture} $exec_output] { 20 fail "32-bit ltrace can not perform on 64-bit PUTs and rebuild ltrace in 64 bit mode!" 21 return 22 } elseif [ regexp {Operation not permitted} $exec_output ] { 23 fail "Operation not permitted, see testrun.log for details!" 24 return 25 } elseif [ regexp {killed by SIGKILL} $exec_output ] { 26 fail "killed by SIGKILL!" 27 return 28 } 29 30 31 32 set pattern "clone" 33 ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1 34 35