*** empty log message ***
This commit is contained in:
@ -93,6 +93,7 @@ proc send {string} {
|
|||||||
global sock lastsent
|
global sock lastsent
|
||||||
set lastsent $string
|
set lastsent $string
|
||||||
puts -nonewline $sock $string
|
puts -nonewline $sock $string
|
||||||
|
flush $sock
|
||||||
}
|
}
|
||||||
|
|
||||||
set timeout 5000
|
set timeout 5000
|
||||||
|
81
streamApp/tests/testIoIntrPollTimeout
Executable file
81
streamApp/tests/testIoIntrPollTimeout
Executable file
@ -0,0 +1,81 @@
|
|||||||
|
#!/usr/bin/env tclsh
|
||||||
|
source streamtestlib.tcl
|
||||||
|
|
||||||
|
# Define records, protocol and startup (text goes to files)
|
||||||
|
# The asynPort "device" is connected to a network TCP socket
|
||||||
|
# Talk to the socket with send/receive/assure
|
||||||
|
# Send commands to the ioc shell with ioccmd
|
||||||
|
|
||||||
|
set records {
|
||||||
|
record (bo, "DZ:ready")
|
||||||
|
{
|
||||||
|
field (DTYP, "stream")
|
||||||
|
field (OUT, "@test.proto ready device")
|
||||||
|
field (PINI, "YES")
|
||||||
|
}
|
||||||
|
record (longin, "DZ:read")
|
||||||
|
{
|
||||||
|
field (DTYP, "stream")
|
||||||
|
field (INP, "@test.proto readintr device")
|
||||||
|
field (SCAN, "I/O Intr")
|
||||||
|
field (FLNK, "DZ:count")
|
||||||
|
}
|
||||||
|
record (calc, "DZ:count")
|
||||||
|
{
|
||||||
|
field (INPA, "DZ:count")
|
||||||
|
field (CALC, "A+1")
|
||||||
|
field (FLNK, "DZ:errorcount")
|
||||||
|
}
|
||||||
|
record (calc, "DZ:errorcount")
|
||||||
|
{
|
||||||
|
field (INPA, "DZ:errorcount")
|
||||||
|
field (INPB, "DZ:read")
|
||||||
|
field (INPC, "DZ:count")
|
||||||
|
field (CALC, "A+(B#C)")
|
||||||
|
}
|
||||||
|
record (longout, "DZ:printresult")
|
||||||
|
{
|
||||||
|
field (DTYP, "stream")
|
||||||
|
field (DOL, "DZ:read")
|
||||||
|
field (OMSL, "closed_loop")
|
||||||
|
field (OUT, "@test.proto printresult device")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
set protocol {
|
||||||
|
Terminator = LF;
|
||||||
|
PollPeriod=10;
|
||||||
|
ReadTimeout=50;
|
||||||
|
ready {out "ready"; }
|
||||||
|
readintr {in "This is a line in chunks with number %d"; }
|
||||||
|
printresult {out "Last line received: %d";
|
||||||
|
out "Line count: %(DZ:count)d";
|
||||||
|
out "Error count: %(DZ:errorcount)d"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
set startup {
|
||||||
|
}
|
||||||
|
|
||||||
|
set debug 0
|
||||||
|
|
||||||
|
startioc
|
||||||
|
|
||||||
|
set rep 10
|
||||||
|
|
||||||
|
assure "ready\n"
|
||||||
|
for {set i 1} {$i <= $rep} {incr i} {
|
||||||
|
send "This "
|
||||||
|
after 10
|
||||||
|
send "is a "
|
||||||
|
after 10
|
||||||
|
send "line in chunks "
|
||||||
|
after 10
|
||||||
|
send "with number $i\n"
|
||||||
|
after 100
|
||||||
|
}
|
||||||
|
ioccmd {dbpf "DZ:printresult.PROC" 1}
|
||||||
|
assure "Last line received: $rep\n"
|
||||||
|
assure "Line count: $rep\n"
|
||||||
|
assure "Error count: 0\n"
|
||||||
|
finish
|
||||||
|
|
33
streamApp/tests/testPercent
Executable file
33
streamApp/tests/testPercent
Executable file
@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/bin/env tclsh
|
||||||
|
source streamtestlib.tcl
|
||||||
|
|
||||||
|
# Define records, protocol and startup (text goes to files)
|
||||||
|
# The asynPort "device" is connected to a network TCP socket
|
||||||
|
# Talk to the socket with send/receive/assure
|
||||||
|
# Send commands to the ioc shell with ioccmd
|
||||||
|
|
||||||
|
set records {
|
||||||
|
record (longout, "DZ:test1")
|
||||||
|
{
|
||||||
|
field (DTYP, "stream")
|
||||||
|
field (OUT, "@test.proto test1 device")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
set protocol {
|
||||||
|
Terminator = LF;
|
||||||
|
test1 {out "\%\e%d\e\e\%";}
|
||||||
|
}
|
||||||
|
|
||||||
|
set startup {
|
||||||
|
var streamDebug 1
|
||||||
|
}
|
||||||
|
|
||||||
|
set debug 0
|
||||||
|
|
||||||
|
startioc
|
||||||
|
|
||||||
|
ioccmd {dbpf DZ:test1 1}
|
||||||
|
assure "%\0331\033\033%\n"
|
||||||
|
|
||||||
|
finish
|
Reference in New Issue
Block a user