tests: parametrize strace-k.test
Prepare for the check of strace -k symbol names demangling. * tests/strace-k.test: Parametrize $test_prog and $expected. * tests/stack-fcall.h: New file. * tests/stack-fcall.c: Include "stack-fcall.h" * tests/stack-fcall-0.c: Likewise. * tests/stack-fcall-1.c: Likewise. * tests/stack-fcall-2.c: Likewise. * tests/stack-fcall-3.c: Likewise. * tests/Makefile.am (EXTRA_DIST): Add stack-fcall.h.
This commit is contained in:
parent
f9c8e8a5b6
commit
23af76cc12
@ -363,6 +363,7 @@ EXTRA_DIST = \
|
||||
setugid.c \
|
||||
sigaltstack.expected \
|
||||
sockname.c \
|
||||
stack-fcall.h \
|
||||
strace-C.expected \
|
||||
strace-E.expected \
|
||||
strace-T.expected \
|
||||
|
@ -1,4 +1,4 @@
|
||||
int f1(int i);
|
||||
#include "stack-fcall.h"
|
||||
|
||||
int f0(int i)
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
int f2(int i);
|
||||
#include "stack-fcall.h"
|
||||
|
||||
int f1(int i)
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
int f3(int i);
|
||||
#include "stack-fcall.h"
|
||||
|
||||
int f2(int i)
|
||||
{
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <unistd.h>
|
||||
#include "stack-fcall.h"
|
||||
|
||||
int f3(int i)
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
int f0(int i);
|
||||
#include "stack-fcall.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
4
tests/stack-fcall.h
Normal file
4
tests/stack-fcall.h
Normal file
@ -0,0 +1,4 @@
|
||||
int f0(int i);
|
||||
int f1(int i);
|
||||
int f2(int i);
|
||||
int f3(int i);
|
@ -38,10 +38,12 @@
|
||||
check_prog sed
|
||||
check_prog tr
|
||||
|
||||
run_prog ../stack-fcall
|
||||
: ${test_prog=../stack-fcall}
|
||||
: ${expected='getpid f3 f2 f1 f0 main '}
|
||||
|
||||
run_prog "$test_prog"
|
||||
run_strace -e getpid -k $args
|
||||
|
||||
expected='getpid f3 f2 f1 f0 main '
|
||||
result=$(sed -r -n '1,/\(main\+0x[a-f0-9]+\) .*/ s/^.*\(([^+]+)\+0x[a-f0-9]+\) .*/\1/p' "$LOG" |
|
||||
tr '\n' ' ')
|
||||
|
||||
@ -50,5 +52,3 @@ test "$result" = "$expected" || {
|
||||
echo "result: \"$result\""
|
||||
dump_log_and_fail_with "$STRACE $args output mismatch"
|
||||
}
|
||||
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user