blob: a8f3c9d603744ef7ef08cb4e1e8e673792ebffde (
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
|
# test for checking monotonic timer (PR3916)
set test "gtod"
if {![installtest_p]} { untested $test; continue }
set wd [pwd]
set filename "$srcdir/$subdir/gtod.c"
target_compile $filename $wd/gtod executable ""
# non interval (check timer drift in short range)
spawn $srcdir/$subdir/gtod.sh $srcdir/$subdir/gtod.stp $wd/gtod
set ok 0
expect {
-timeout 120
-re {^[0-9]+ \:([0-9]+) appl\r\n[0-9]+ \:\1 kern\r\n[0-9]+ \:\1 prog\r\n} { incr ok; exp_continue }
timeout { fail "$test (timeout)" }
eof { }
}
wait
#10ms interval (check timer drift in middle range)
spawn $srcdir/$subdir/gtod.sh $srcdir/$subdir/gtod.stp $wd/gtod 10000
expect {
-timeout 120
-re {^[0-9]+ \:([0-9]+) appl\r\n[0-9]+ \:\1 kern\r\n[0-9]+ \:\1 prog\r\n} { incr ok; exp_continue }
timeout { fail "$test (timeout)" }
eof { }
}
wait
#100ms interval (calm down processors and CPU freq might be changed)
spawn $srcdir/$subdir/gtod.sh $srcdir/$subdir/gtod.stp $wd/gtod 100000
expect {
-timeout 120
-re {^[0-9]+ \:([0-9]+) appl\r\n[0-9]+ \:\1 kern\r\n[0-9]+ \:\1 prog\r\n} { incr ok; exp_continue }
timeout { fail "$test (timeout)" }
eof { }
}
wait
exec rm -f $wd/gtod
if {$ok == 300} { pass "$test ($ok)" } { fail "$test ($ok)" }
|