Sign in to follow this  
Followers 0
Jon

Test Script Request

10 posts in this topic

Could someone code me up a test script so when I mess around with the internals of AutoIt I can be reasonably sure that I've not broken anything.

I was thinking of a script to work out some numbers or something so that when it finishes it compares the result with what it _should_ have calculated - if the two are different then a bug has been introduced. So it must:

- Use lots of variables in both the Global and Local scope

- Use complicated expressions

- Use all sorts of loops and nested loops

- Use lots of function calls, with and without ByRefs

- Use a little recursion to be sure that it is working

I want it to be pretty silent too, with the only outputs being stuff like:

"Complex functions - passed"

"Expressions - passed"

"Complex loops - passed"

Testing each built in function in detail is not required, if a single built in function works then they should all work, it's more the user functions, expressions, loops I'm concerned with.

Seperate scripts to test each area would be fine too.

(I know JP has some non-regression code but this is a little different, I don't actually _have_ any complicated AutoIt scripts as I've been too busy writing the thing!)

Share this post


Link to post
Share on other sites



lol.. omg.. ok, i seriously just thought this: "i could probably do the loop thing, but im just too lazy... i wonder if i could make a script to do it for me".... lol....

Share this post


Link to post
Share on other sites

Jon,

Just some precision before I try to fulfill your request.

- Use lots of variables in both the Global and Local scope

lots means testing perf or just the complexity of global/local/func

- Use complicated expressions

using operator as ^*/+-() and the function as ROUND not math functions return

- Use all sorts of loops and nested loops

with function call embedded or not?

- Use lots of function calls, with and without ByRefs

OK

- Use a little recursion to be sure that it is working

how many level?

Share this post


Link to post
Share on other sites

;------------------------------------
$loops = 3;3 seems good, takes like 20 seconds for me with $trays set to 5
$trays = 5;shows you whats going on, but slows it down a bit the higher you go, cant go higher than the amount in $var
$trayson = 0;if anything but 1, it wont put in the traytip
$loopies = 6;how many loops to do

$loops = InputBox("Loops", "How many times should each For loops loop?", $loops)
if @error=1 Then Exit
$trays = InputBox("Trays", "How many loops should show up in TrayTip?", $trays)
if @error=1 Then Exit
$loopies = InputBox("Total For Loops", "How many For loops do you want? Max is 26.", $loopies)
if @error=1 Then Exit
if $loopies>26 Then Exit
$answer = MsgBox(4,"Trays","Do you want the TrayTip to be on? It slows it down, but atleast you know whats going on.")
if @error=1 Then Exit
if $answer=6 Then $trayson=1

$var = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"
$var = StringTrimRight($var,(26-$loopies)*2)
$var = StringSplit($var,",")
if $var[0]<$trays Then
MsgBox(0,"Fool","You are trying to show more in the traytip than you actually have.. exiting..")
Exit
EndIf

Run("Notepad")
WinWaitActive("Untitled")
AutoItSetOption("SendKeyDelay",0)

Send("ProgressOn(+'Looping+',+'Looping...+',+'+',0,@DesktopHeight-200){enter}")
Send("$loops = " & $loops & "{enter}")
Send("$process=0{enter}")
Send("For $MainLoop=0 to $loops{enter}")

For $i=1 to $var[0]
    Send("For $" & $var[$i] & "=0 to $loops{enter}")
    For $t=1 to $i
  Send("{tab}")
    Next
Next

Send(";weee{enter}")

if $trayson=1 Then
    For $t=1 to $var[0]
  Send("{tab}")
    Next
    Send("TrayTip(+'Loop+',$MainLoop & +'  +' & " )
    For $i=1 to $trays
  Send("$" & $var[$i] & " & +', +' & ")
    Next
    Send("{backspace 10},1){enter}")
EndIf

For $i=($var[0]-1) to 0 Step -1
    For $t=1 to $i
  Send("{tab}")
    Next
    Send("Next{enter}")
Next

Send("$process=(100/$loops){+}$process{enter}ProgressSet($process)")
Send("{enter}Next{enter}")
Send("MsgBox(0,+'Finished+',+'Looping is complete.+')")
send("^s")
Sleep(200)
Send("TestLoops.au3")
;------------------------------------

i um...

have no life?

Share this post


Link to post
Share on other sites

Lots meaning complexity :whistle:

And just a few levels of recursion.  Everything else you said sounds fine.

Thanks, JP.

The process is started

You will be proud of your student ...

I could reach grade 3

Share this post


Link to post
Share on other sites

just edit mine to write the code for you, lol... somebody needs to use my code =P

Share this post


Link to post
Share on other sites

hello,

since 2 month:

i have a game bot beta version released in 3 days with 4000 lines script and a 3000 lines ascii database oriented at my job, they have deep loops (up to 15 in certain cases, calling subs with others loops...not "while 1" loops...

Every days yet i update immediately to next version, not problems yet...except a special crash causing memory exception but i dont remember what caused it, it was a syntax error, not a core error.

If you have D2 lod game at home i think you will have a nice "complex" testing in 3 minutes. :whistle:

:iamstupid:

Anyway, that was more a tx you for your core than an help but...B)

Share this post


Link to post
Share on other sites

haha... i have no life, and way to much free time... if you ever need a script that makes another script again, lemme know =P

Share this post


Link to post
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
Sign in to follow this  
Followers 0