| 1 |
set test "strftime" |
| 2 |
if {![installtest_p]} { untested $test; return } |
| 3 |
|
| 4 |
# cleanup |
| 5 |
system "rm -f %*" |
| 6 |
|
| 7 |
foreach runtime [get_runtime_list] { |
| 8 |
set test "strftime" |
| 9 |
if {$runtime != ""} { |
| 10 |
lappend test "($runtime)" |
| 11 |
} |
| 12 |
|
| 13 |
# check %S and %T |
| 14 |
set format %%%S_%T |
| 15 |
if {$runtime != ""} { |
| 16 |
verbose -log {stap --runtime=$runtime -o $format -we {probe begin {println("hello");exit()}}} |
| 17 |
catch { exec stap --runtime=$runtime -o $format -we {probe begin {println("hello");exit()}} } res |
| 18 |
} else { |
| 19 |
verbose -log {stap -o $format -we {probe begin {println("hello");exit()}}} |
| 20 |
catch { exec stap -o $format -we {probe begin {println("hello");exit()}} } res |
| 21 |
} |
| 22 |
verbose -log $res |
| 23 |
|
| 24 |
set file [glob -nocomplain -types f %\[0-9\]\[0-9\]_\[0-9\]\[0-9\]:\[0-9\]\[0-9\]:\[0-9\]\[0-9\]] |
| 25 |
|
| 26 |
if {[llength $file] == 1} { |
| 27 |
pass "$test (%S and %T)" |
| 28 |
} else { |
| 29 |
fail "$test (%S and %T)" |
| 30 |
} |
| 31 |
|
| 32 |
# check except for %S and %T |
| 33 |
set format %%,%C,%Y,%y,%m,%d,%e,%F,%H,%I,%j,%k,%l,%M,%R,%u,%w |
| 34 |
|
| 35 |
set date1 [exec date +$format] |
| 36 |
|
| 37 |
# run stapio with strftime |
| 38 |
if {$runtime != ""} { |
| 39 |
verbose -log {stap --runtime=$runtime -o $format -we {probe begin {println("hello");exit()}}} |
| 40 |
catch { exec stap --runtime=$runtime -o $format -we {probe begin {println("hello");exit()}} } res |
| 41 |
} else { |
| 42 |
verbose -log {stap -o $format -we {probe begin {println("hello");exit()}}} |
| 43 |
catch { exec stap -o $format -we {probe begin {println("hello");exit()}} } res |
| 44 |
} |
| 45 |
verbose -log $res |
| 46 |
|
| 47 |
if {[file exists $date1]} { |
| 48 |
pass "$test (except %S and %T)" |
| 49 |
} else { |
| 50 |
fail "$test (except %S and %T)" |
| 51 |
} |
| 52 |
|
| 53 |
# cleanup |
| 54 |
system "rm -f %*" |
| 55 |
} |