diff options
author | William Cohen <wcohen@redhat.com> | 2009-05-20 19:03:34 -0400 |
---|---|---|
committer | William Cohen <wcohen@redhat.com> | 2009-05-20 19:03:34 -0400 |
commit | c14aff52d5ec1f8a1326060b6378a973d3bb5b2a (patch) | |
tree | a6c5f4ce56a8367153cd2ed6399275fa0029422d /testsuite | |
parent | 34029cd3afe690f8481f8921047ec39dc325d945 (diff) | |
parent | 4acb6884cdfa8205a60b203aa9e48ab79efd9ea2 (diff) | |
download | systemtap-steved-c14aff52d5ec1f8a1326060b6378a973d3bb5b2a.tar.gz systemtap-steved-c14aff52d5ec1f8a1326060b6378a973d3bb5b2a.tar.xz systemtap-steved-c14aff52d5ec1f8a1326060b6378a973d3bb5b2a.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/buildok/gtod_init.stp | 13 | ||||
-rwxr-xr-x | testsuite/buildok/gtod_noinit.stp | 13 | ||||
-rw-r--r-- | testsuite/systemtap.base/gtod_init.exp | 29 |
3 files changed, 26 insertions, 29 deletions
diff --git a/testsuite/buildok/gtod_init.stp b/testsuite/buildok/gtod_init.stp new file mode 100755 index 00000000..1d76aeab --- /dev/null +++ b/testsuite/buildok/gtod_init.stp @@ -0,0 +1,13 @@ +#! stap -gp4 + +# check that STAP_NEED_GETTIMEOFDAY is defined with a gettimeofday +function check() %{ +#ifndef STAP_NEED_GETTIMEOFDAY +#error "gettimeofday should define STAP_NEED_GETTIMEOFDAY!" +#endif +%} + +probe begin { + check() + println(gettimeofday_s()) +} diff --git a/testsuite/buildok/gtod_noinit.stp b/testsuite/buildok/gtod_noinit.stp new file mode 100755 index 00000000..94a9dfdc --- /dev/null +++ b/testsuite/buildok/gtod_noinit.stp @@ -0,0 +1,13 @@ +#! stap -gp4 + +# check that STAP_NEED_GETTIMEOFDAY is NOT defined without a gettimeofday +function check() %{ +#ifdef STAP_NEED_GETTIMEOFDAY +#error "STAP_NEED_GETTIMEOFDAY should not be defined!" +#endif +%} + +probe begin { + check() + println(get_cycles()) +} diff --git a/testsuite/systemtap.base/gtod_init.exp b/testsuite/systemtap.base/gtod_init.exp deleted file mode 100644 index 48616b1f..00000000 --- a/testsuite/systemtap.base/gtod_init.exp +++ /dev/null @@ -1,29 +0,0 @@ -# test for checking initialization of the time subsystem -set test "gtod_init" - -# check that init and kill are both present with a gettimeofday -set time_init 0 -set time_kill 0 -spawn stap -p2 -e {probe begin { println(gettimeofday_s()) }} -expect { - -timeout 120 - -re {\n_gettimeofday_init:} { incr time_init; exp_continue } - -re {\n_gettimeofday_kill:} { incr time_kill; exp_continue } - timeout { fail "$test (timeout)" } - eof { - if {$time_init == 1} { pass "$test (init)" } { fail "$test (init $time_init)" } - if {$time_kill == 1} { pass "$test (kill)" } { fail "$test (kill $time_kill)" } - } -} -wait - -# check that init and kill are both NOT present without a gettimeofday -spawn stap -p2 -e {probe begin { println(get_cycles()) }} -expect { - -timeout 120 - -re {\n_gettimeofday_init:} { fail "$test (bad init)" } - -re {\n_gettimeofday_kill:} { fail "$test (bad kill)" } - timeout { fail "$test (timeout)" } - eof { pass "$test (no init/kill)" } -} -wait |