Resumes automatic logging of test results by ATEasy after it was suspended by the SetLogOff subroutine.
[ bPrvState = ] SetLogOn ( )
The SetLogOn procedure syntax has the following parts:
Name |
Type |
Description |
bPrvState |
Bool |
Log state before calling the function |
bPrvState can have one of the following values:
Value |
Description |
True |
Log state was On. |
False * |
Log state was Off. |
ATEasy automatically logs test results, as each Test generates output to Log. The automatic result logging may be suspended using the SetLogOff subroutine and may be resumed later using this subroutine.
The following example uses SetLogOff/SetLogOn to print only the failed tests. All the strings here are defined as 512 characters long (the nPrvTable, nTable, and sTable) should be declared as program variables.
OnInitTask ( )
{
! we have no table
nPrvTable=-1
SetLogOn()
}
OnEndTask ( )
{
SetLogOn()
}
OnEndTest ( )
{
SetLogOff()
sLog=GetLogString()
! i holds the end of the table
i=Pos("-\r\n", sLog)
If i >= 0
sTable=Mid(sLog, 0, I+3) ! the last table header
sLog=Right(sLog, I+3) ! the test results
nTable=GetTestType() ! the last test table type
Endif
If TestStatus > PASS
If nTable <> iPrvTable
Print sTable;
! update the displayed table type
nPrvTable=nTable
Endif
! the test result
Print sLog;
Endif
}