summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/uprobes_uname.exp
blob: 65e1ff70656b91d0bd88933288c588909e087898 (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
45
46
set test "uprobes_uname"
set testpath "$srcdir/$subdir"
set testsrc  "$testpath/uprobes_exe.c"
set testsrclib  "$testpath/uprobes_lib.c"
set testexe  "./uprobes_exe"
set testlibname  "uprobes_lib"
set testlibdir "."
set testso  "$testlibdir/lib${testlibname}.so"
set testflags "additional_flags=-g additional_flags=-O"
set testlibflags "$testflags additional_flags=-fPIC additional_flags=-shared"
set maintestflags "$testflags additional_flags=-L$testlibdir additional_flags=-l$testlibname additional_flags=-Wl,-rpath,$testlibdir"

# Compile our test program and library.
set res [target_compile $testsrclib $testso executable $testlibflags]
if { $res != "" } {
    verbose "target_compile for $testso failed: $res" 2
    fail "$test compile $testsrclib"
    return
} else {
    pass "$test compile $testsrclib"
}

set res [target_compile $testsrc $testexe executable $maintestflags]
if { $res != "" } {
    verbose "target_compile failed: $res" 2
    fail "$test compile $testsrc"
    return
} else {
    pass "$test compile $testsrc"
}

set ::result_string {exe: main=main
exe: main_func=main_func
exe: main_func=main_func
exe: main_func=main_func
lib: lib_main=lib_main
lib: lib_func=lib_func
lib: lib_func=lib_func
lib: lib_func=lib_func}

# Only run on make installcheck
if {! [installtest_p]} { untested "$test"; return }
if {! [utrace_p]} { untested $test; return }
stap_run2 $srcdir/$subdir/$test.stp -c $testexe

#exec rm -f $testexe $testso