Jump to content
Sign in to follow this  
zwobot

Testing functions and scripts?

Recommended Posts

I wonder if there is some kind of "Unit tester" for Operation Flashpoint or Armed Assault scripts and functions.

Do you know the problem of when you have some functions or scripts for your Ofp or ArmA mission and you write dozens of formatted hints to check the values of your variables?

Some of you might know JUnit, PHPUnit and all the other xUnit testtools and I think something similar would come in handy for testing functions as they have a return value. Scripts are a bit different but they need to be tested too.

What do you think? Is it possible, and useful to have a testtool for functions (and scripts)?

Share this post


Link to post
Share on other sites

There is nothing better right now than using a console IMO.

By console, I am refering to the wonderful consoles by vektorboson. They are in-game dialogs you can use to call commands at any time.

You can then call a function using whatever parameters you wish and see the results.

I haven't used any console for ArmA, but when I used the OFP one... I was very happy with it.

A "real" unit tester would be nice though but I dont think it is plausible. In OFP, I developed a script monitor which would monitor running scripts and provide the parameters sent. It required minimum two lines of code in each script to be monitored and was completely transparent (i.e. released mission did not need the actual monitor scripts included and the scripts using monitor code would not error out). It did not do unit testing though, but it could be modified to do so.

The problem is, however, that I relied on the CoC_NS framework to provide the data from clients. This does not work in ArmA. So, the monitor would need to be written from the ground up using only PV... which IMo isn't reliable enough. It may be worth looking into though.

Share this post


Link to post
Share on other sites

Uh, the consoles obviously slipped out of my mind. I have used one some months ago actually...

But I think they must be sufficient for most scripting purposes. Also many people still seem to use scripts rather than functions, which makes a real "unit tester" not very applicable indeed.

Thank you for mentioning the consoles though, CrashDome. They are very much what I was looking for for testing the outcomes of my functions and scripts.

Probably one cannot check values of private/local variables with a console. I haven't checked yet but I cannot imagine that it is possible.

Share this post


Link to post
Share on other sites

How do you get the vektorboson console to work for Arma?

Following the instructions do not work for Arma?

Or is there an equivalent console that can be used for Arma?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×