Jump to content

running multiple test cases with single script


Recommended Posts

Hi,

I developed some test cases and I would like to run all the cases with a single scipt. This single scrpt should give me test case results as well.

Lets say I have 5 test cases. after running I would like see how many cases failed and passed.

Can some one help me by providing sample script.

thanks in advance.

Link to comment
Share on other sites

erm... without seeing what this "case" you are testing is, i cannot really help.

.. perhaps if then statements that check error levels?

if @error = 0 Then

Msgbox(0, "Case 1", "Failed")

ElseIf @error = 1 Then

MsgBox(0, "Case 1", "Passed")

Else

MsgBox(0, "Case 1", "Un-defined value returned")

EndIf

How's that? (no idea if it actually runs, but it should be a good example.) Edited by tAKTelapis
Link to comment
Share on other sites

Without specifics - all we can do is to offer more "general" answers.

It could look like this:

Global $test1_flag, $test2_flag
Func Test1()
    ;run test here
    ;if test OK
    $test1_flag = 1
    ;if test failed
    $test1_flag = 0
EndFunc

Func Test2()
    ;run test here
    ;if test OK
    $test2_flag = 1
    ;if test failed
    $test2_flag = 0
EndFunc

Func results ()
    $success = ""
    $fails = ""
    If $test1_flag = 1 Then
        $success &= "Test1 OK"
        $success &= @CRLF
    Else
        $fails &= "Test1 Failed"
        $fails &= @CRLF
    EndIf
    If $test2_flag = 1 Then
        $success &= "Test2 OK"
        $success &= @CRLF
    Else
        $fails &= "Test2 Failed"
        $fails &= @CRLF
    EndIf
    MsgBox(0, "Statistics", "Passed tests:"&@CRLF&$success&@CRLF&"Failed tests:"&@CRLF&$fails)
EndFunc

It is not the shortest and "economical" way to do this but - hey - without some code I cannot do more.

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...