-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathutc.exp
More file actions
41 lines (35 loc) · 1.87 KB
/
Copy pathutc.exp
File metadata and controls
41 lines (35 loc) · 1.87 KB
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
41
#!/usr/bin/expect
# uncomment line below for debugging
# exp_internal 1
set timeout 7
source ./ci/expect_scripts/shared-code.exp
spawn $env(TESTS_DIR)utc
expect -re "Current time in milliseconds since epoch: \[0-9\]+" {
expect -re "Time reconstructed from milliseconds: \[0-9\]{4}-\[0-9\]{2}-\[0-9\]{2}T\[0-9\]{2}:\[0-9\]{2}:\[0-9\]{2}Z" {
expect -re "Current time in nanoseconds since epoch: \[0-9\]+" {
expect -re "Time reconstructed from nanoseconds: \[0-9\]{4}-\[0-9\]{2}-\[0-9\]{2}T\[0-9\]{2}:\[0-9\]{2}:\[0-9\]{2}Z" {
expect "Time delta demonstration:" {
expect -re "Starting time: \[0-9\]{4}-\[0-9\]{2}-\[0-9\]{2}T\[0-9\]{2}:\[0-9\]{2}:\[0-9\]{2}Z" {
expect -re "Ending time: \[0-9\]{4}-\[0-9\]{2}-\[0-9\]{2}T\[0-9\]{2}:\[0-9\]{2}:\[0-9\]{2}Z" {
expect -re "Time elapsed: \[0-9\]+ milliseconds" {
expect -re "Time elapsed: \[0-9\]+ nanoseconds" {
expect -re "Nanoseconds converted to milliseconds: \[0-9\]+\.\[0-9\]+" {
expect "Verified: deltaMillis and deltaNanos/1_000_000 match within tolerance" {
expect "Test completed successfully!" {
expect eof {
check_exit_and_segfault
}
}
}
}
}
}
}
}
}
}
}
}
}
puts stderr "\nExpect script failed: output was different from expected value. uncomment `exp_internal 1` to debug."
exit 1