Home | History | Annotate | Download | only in ltrace.torture
      1 # This file was written by Yao Qi <qiyao (at) cn.ibm.com>.
      2 
      3 set testfile "vfork-thread"
      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 [list debug ldflags=-pthread] ] != "" } {
     11      send_user "Testcase compile failed, so all tests in this file will automatically fail\n."
     12 }
     13 
     14 ltrace_options "-f"
     15 
     16 # Run PUT for ltarce.
     17 set exec_output [ltrace_runtest $objdir/$subdir $objdir/$subdir/$binfile]
     18 
     19 # Check the output of this program.
     20 verbose "ltrace runtest output: $exec_output\n"
     21 if [regexp {ELF from incompatible architecture} $exec_output] {
     22 	fail "32-bit ltrace can not perform on 64-bit PUTs and rebuild ltrace in 64 bit mode!"
     23 	return
     24 } elseif [ regexp {Couldn't get .hash data} $exec_output ] {
     25 	fail "Couldn't get .hash data!"
     26 	return
     27 }
     28 
     29 ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace "puts" 9
     30 ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace "sleep" 7
     31 ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace "vfork resumed" 2
     32 ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace "_exit" 1
     33