41 posts
Posted 19 March 2014 - 08:58 PM
This
might already be a possibility, but I am not sure. I think it would be great if there was a way for us to be able to write unit tests for testing our ComputerCraft programs. I have found as I am working on larger and larger scripts, when something breaks, it becomes a pain to debug the problems. I think for larger scale ComputerCraft scripts, being able to use
LUnit would be amazing.
LUnit says it supports Lua 5.1 or newer. I do not know how complete the Lua interrupter is for ComputerCraft so I do not know if this would be possible. If it would not be too difficult, it would be awesome if we could get it to work. Also, possible a way to build and break down a "virtual" computer/turtle for us to be able to develop it on a local machine.
8543 posts
Posted 20 March 2014 - 12:15 AM
LUnit itself requires the debug library, which is not present in the Lua libraries offered in ComputerCraft. You would have to set up some sort of emulator specifically designed to allow testing using the debug library, which then (of course) would not necessarily be a truly accurate representation of the way ComputerCraft would execute your script.
I agree that better debugging facilities would be useful at times, but they are unfortunately too powerful, apparently allowing one to break out of the sandbox.
41 posts
Posted 20 March 2014 - 02:19 AM
I agree that better debugging facilities would be useful at times, but they are unfortunately too powerful, apparently allowing one to break out of the sandbox.
Perhaps an official ComptuerCraft emulator then with better debug capabilities and the debug library needed? Like write a plugin for Eclipse or IntelliJ that let you use the emualtor from source and then emulate a ComputerCraft computer/turtle and allow it to run in "debug" or "game" mode. If it is in game mode it could not use those extra libraries.
995 posts
Location
Canada
Posted 20 March 2014 - 06:22 AM
I'd personally love a config option for using the debug library, maybe on specific computer IDs.
1610 posts
Posted 20 March 2014 - 01:39 PM
I'd personally love a config option for using the debug library, maybe on specific computer IDs.
Think it was clearly stated it wouldn't be added. It would be very useful, for, well, debugging, but open a LOT of security issues.
995 posts
Location
Canada
Posted 20 March 2014 - 07:13 PM
Hmm, guess I missed that. Though I'd love a config option, I can see grieves using it to run arbitrary code outside the sandbox.