vfork-thread.exp revision bf6b270bf2b6268153efc88cc5808ffd9bcb596e
1# This file was written by Yao Qi <qiyao@cn.ibm.com>.
2
3set testfile "vfork-thread"
4set srcfile ${testfile}.c
5set binfile ${testfile}
6
7
8verbose "compiling source file now....."
9# Build the shared libraries this test case needs.
10if  { [ 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
14ltrace_options "-f"
15
16# Run PUT for ltarce.
17set exec_output [ltrace_runtest $objdir/$subdir $objdir/$subdir/$binfile]
18
19# Check the output of this program.
20verbose "ltrace runtest output: $exec_output\n"
21if [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
29ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace "puts" 9
30ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace "sleep" 7
31ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace "vfork resumed" 2
32ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace "_exit" 1
33