From d57671d335d788aa3a738f7f284bfee30151c86c Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Tue, 10 Jun 2008 16:54:29 -0400 Subject: PR6470: new argv[] tapset, docs, test cases --- testsuite/ChangeLog | 6 ++++++ testsuite/parseko/preprocess08.stp | 4 ++-- testsuite/parseko/preprocess08b.stp | 4 ++++ testsuite/systemtap.base/cmd_parse.exp | 37 ++++++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100755 testsuite/parseko/preprocess08b.stp (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index bdae76e3..48f6fbcb 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2008-06-10 Frank Ch. Eigler + + PR 6470. + * parseko/preprocess08.stp, ...08b.stp: Revised/new test. + * systemtap.base/cmd_parse.exp: Added some argv[] tests. + 2008-06-09 Stan Cox * systemtap.base/stmt_rel.stp: New test. diff --git a/testsuite/parseko/preprocess08.stp b/testsuite/parseko/preprocess08.stp index 6665983d..ba0d68e2 100755 --- a/testsuite/parseko/preprocess08.stp +++ b/testsuite/parseko/preprocess08.stp @@ -1,4 +1,4 @@ #! stap -p1 -# missing "then" token -%( arch == "2.6" %? +# premature EOF during THEN tokens +%( 0 == 0 %? diff --git a/testsuite/parseko/preprocess08b.stp b/testsuite/parseko/preprocess08b.stp new file mode 100755 index 00000000..a9697c28 --- /dev/null +++ b/testsuite/parseko/preprocess08b.stp @@ -0,0 +1,4 @@ +#! stap -p1 + +# premature EOF during ELSE tokens +%( 0 == 1 %? %: diff --git a/testsuite/systemtap.base/cmd_parse.exp b/testsuite/systemtap.base/cmd_parse.exp index cbce0455..e33bfa85 100644 --- a/testsuite/systemtap.base/cmd_parse.exp +++ b/testsuite/systemtap.base/cmd_parse.exp @@ -84,3 +84,40 @@ expect { eof {fail "cmd_parse8: unexpected EOF"} } wait + +spawn stap -e {probe begin { printf("%d %s\n", argc, argv[$1]) exit() }} 1 +expect { + -timeout 60 + "1 1" { pass cmd_parse9 } + timeout { fail "cmd_parse9 timeout" } + eof { fail "cmd_parse9 eof" } +} +wait + +spawn stap -e {probe begin { printf("%d %s\n", argc, argv[$1]) exit() }} 5 a b c d +expect { + -timeout 60 + "5 d" { pass cmd_parse10 } + timeout { fail "cmd_parse10 timeout" } + eof { fail "cmd_parse10 eof" } +} +wait + +spawn stap -e {probe begin { printf("%d %s\n", argc, argv[$1]) exit() }} 10 a b c d +expect { + -timeout 60 + "5 " { pass cmd_parse11 } + timeout { fail "cmd_parse11 timeout" } + eof { fail "cmd_parse11 eof" } +} +wait + +spawn stap -e {probe begin { printf("%d %s\n", argc, argv[0]) exit() }} +expect { + -timeout 60 + "0 " { pass cmd_parse12 } + timeout { fail "cmd_parse12 timeout" } + eof { fail "cmd_parse12 eof" } +} +wait + -- cgit