- Added regression tests for a counter and the new MultiCounter
- Enhanced regression tests for motors
This commit is contained in:
@ -17,7 +17,7 @@ proc compareValue {is should} {
|
||||
error "Bad compare is: $is, should $should"
|
||||
}
|
||||
} else {
|
||||
if {[string compare $is $rhould] != 0} {
|
||||
if {[string compare $is $should] != 0} {
|
||||
error "Bad compare is: $is, should $should"
|
||||
}
|
||||
}
|
||||
@ -87,3 +87,55 @@ proc testDriveInterrupt {name value} {
|
||||
}
|
||||
return OK
|
||||
}
|
||||
#---------------------------------------------------------------------
|
||||
proc testNBCounting {startCommand waitTime} {
|
||||
set res [$startCommand]
|
||||
if {[string first ERROR $res] >= 0} {
|
||||
error "Starting count failed with $res"
|
||||
}
|
||||
exec sleep 1
|
||||
set res [SICSValue status]
|
||||
if {[string first "Count" $res] < 0} {
|
||||
error "Status does not say counting"
|
||||
}
|
||||
exec sleep $waitTime
|
||||
set res [SICSValue status]
|
||||
if {[string first "Eager" $res] < 0} {
|
||||
error "Counting did not stop"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
#----------------------------------------------------------------
|
||||
proc testBlockCounting {startCommand waitTime} {
|
||||
set res [$startCommand]
|
||||
if {[string first ERROR $res] >= 0} {
|
||||
error "Starting count failed with $res"
|
||||
}
|
||||
exec sleep $waitTime
|
||||
set res [SICSValue status]
|
||||
if {[string first "Eager" $res] < 0} {
|
||||
error "Counting did not stop"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
#---------------------------------------------------------------
|
||||
proc testInterruptedCount {startCommand} {
|
||||
global socke
|
||||
set res [$startCommand]
|
||||
if {[string first ERROR $res] >= 0} {
|
||||
error "Starting count failed with $res"
|
||||
}
|
||||
puts $socke "INT1712 3"
|
||||
flush $socke
|
||||
exec sleep 10
|
||||
set ans [eval status]
|
||||
config rights Spy Spy
|
||||
if {[string first Interrupt $ans] < 0} {
|
||||
puts stdout $ans
|
||||
error "Failed to abort counting"
|
||||
}
|
||||
if { [string first Eager $ans] < 0} {
|
||||
error "Failed to finish counting"
|
||||
}
|
||||
return OK
|
||||
}
|
Reference in New Issue
Block a user