How to find the line coverage statistics

I’m having trouble with finding the line coverage statistics using random test.
How do i get this information?
All i get is something like this

*****Seed 0
startup *choice 73#4 (line 101) #It’s not that that simple, but call me as “he”.
startup *choice 113#1 (line 114) #Nah. I got it!
*****Seed 1
startup *choice 73#4 (line 101) #It’s not that that simple, but call me as “he”.
startup *choice 113#1 (line 114) #Nah. I got it!
*****Seed 2
and so on until 9999

I`m marking the opition to show the line coverage statistics…

You mean average playthrough wordcount? IIRC, divide the wordcount you get at the end of your test with the number of your iteration times.

I just realized that the “Show line coverage statistics after test” option doesn’t work for me either. When I pick line coverage it won’t show the coverage statistics and it won’t say that randomtest passed and the time. (It seems like the “Automatically scroll to the bottom” option doesn’t work, too, but that doesn’t stop it from showing that randomtest passed or how long the test took.)

From what I can tell this is because of the recent firefox updates. I use the upload/non-node method like @Brian_Rushton did, so I’m not sure if that has anything to do with it.

1 Like

I ended up having to use node after all to get line coverage statistics. It was obnoxious but worth it

1 Like

Will try again, I tried it once but there were no diference in the result…

what do I do to test it on node? just downloaded it

Open up the node.js command prompt, and go to choicescript-master

There’s a file called run-randomtest.bat. You can run it just by typing “run-randomtest”

I edited it so it said this:

node randomtest num=10000 seed=0 avoidUsedOptions=false showChoices=false showText=false showCoverage=true

You can change the options to anything you want.

Also, instead of using the .bat file, you can just type commands exactly like the one above when you’re in that folder.

Just to add in, you must say yes when it asks “Show full text?” Otherwise it won’t show wordcount

Edit:Just realized this thread is almost a year old haha

1 Like

This is excellent, I’d run into a problem with randomtest and line coverage and it’s helped me get it working! Do you (or anyone else reading) know how to add the option where you save the output to randomtest-output?

edit: interestingly, it seems to be working OK now (fingers crossed) so I’m not totally sure what the issue was… but good overall I think?

I’ve marked the solution for future forum divers!

edit #2 for my future self because I seem to return to this thread each time I forget how this works (or anyone else who would find it useful): to get line coverage and outputting to randomtest-output, open run-randomtest and when choosing your options, choose not to show full text, which then opens up the line coverage and output options. If you show full text, by default it doesn’t allow you to output.

1 Like

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.