From: Mark O'D. <mar...@lu...> - 2001-07-31 01:33:50
|
John Bellardo wrote: > Mark, > > On Sunday, July 29, 2001, at 10:27 AM, Mark O'Donohue wrote: > >> >> Hi >> >> [....] >> I've been looking at the dejagnu system >> (http://dejagnu.sourceforge.net). >> It was recommened by a couple of people as suitable for what we are >> trying to do, and is fairly simple to code test cases in. >> >> So dejagnu is a fairly simple protocol built on top of the NIST >> expect tool (http://expect.nist.gov) - I've also written a couple of >> programs in expect and Im confident that it has the features that we >> needs. >> >> [....] > > > What is it going to take to get dejagnu up to speed on the LIMIT > tests? I'd like to familiarize myself with the system. I've been > skimming the dejagnu manual, but I figured I'd ask you how much you > had finished. Is it to the point you can commit it (in > interbase/testcases) so others can start fiddling? What still needs > to be done? Just start writing the test scripts in expect, use autoexpect to generate the first one then cull it. Something like the following, (Im not at my proper desk, so it's all a bit off the cuff here and some little changes will be needed - the expression set a (b - a) I need to check the syntax for. #!/usr/bin/expect -f proc runlimit { testname offset limit} { global prompt send "select 'XXX' from rdb$tables limit($offset, $limit)\r" set counter 0 # loop round counting the numer of selects, and when get a prompt again continue. expect { "XXX" { counter++ exp_continue } $prompt { } } # check results and print success/failure. set expectedAmount (limit - offset) if (counter == expectedAmount) { send_user "Passed - $testname " } else { send_user "Success - $testname" } } # main program #start isql spawn isql set prompt "SQL>" runlimit ("test1", 0, 50) runlimit ("test2", 50, 50 ) # you can see that it would be easy to add a function that checks for a general error message such as : #runlimitBad ("test2", -1, 50 ) Cheers Mark |