Nasal Unit Testing Framework: Difference between revisions

Jump to navigation Jump to search
Switched to {{gitorious source}} to provide functional links to the archived repositories.
(→‎Status 06/2013: New tmeplate + dead links)
(Switched to {{gitorious source}} to provide functional links to the archived repositories.)
Line 36: Line 36:
Based on what I read about the current stand-alone interpreter this should be fairly easy to do. That should now be possible, the nasal-standalone branch builds successfully for Windows (make sure to have boost available for building cppbind):
Based on what I read about the current stand-alone interpreter this should be fairly easy to do. That should now be possible, the nasal-standalone branch builds successfully for Windows (make sure to have boost available for building cppbind):


Here's the Nasal standalone interpreter as part of SimGear: https://gitorious.org/~hooray/fg/hoorays-simgear/commits/topics/nasal-standalone{{dead link}}
Here's the Nasal standalone interpreter as part of SimGear: {{gitorious source|proj=fg|repo=hoorays-simgear|branch=topics/nasal-standalone|view=shortlog}}
Just check out the branch named "nasal-bin".
Just check out the branch named "nasal-bin".


Line 47: Line 47:
make
make
</syntaxhighlight>
</syntaxhighlight>
People not using Git, can also directly download the source code: https://gitorious.org/fg/hoorays-simgear/archive-tarball/topics/nasal-standalone{{dead link}}
(Use 7Zip or IZArc to extract the tarball. Then follow the build instructions (you can also use the cmake GUI for those).


Basically
Basically
Line 63: Line 59:
Let us know if there are still any windows-specific build errors so that we can fix the config file. It should give you a "nasal-bin.exe" in $SG_BUILD/simgear/nasal/ that runs just Nasal scripts, no FG APIs whatsoever - you '''need''' to pass a valid Nasal script when running the file.
Let us know if there are still any windows-specific build errors so that we can fix the config file. It should give you a "nasal-bin.exe" in $SG_BUILD/simgear/nasal/ that runs just Nasal scripts, no FG APIs whatsoever - you '''need''' to pass a valid Nasal script when running the file.


You should be able to "make test" to run a bunch of standard Nasal tests from the original Nasal repository, which are to be found in $SG_SRC/nasal/tests: https://gitorious.org/~hooray/fg/hoorays-simgear/trees/topics/nasal-standalone/simgear/nasal/tests{{dead link}}
You should be able to "make test" to run a bunch of standard Nasal tests from the original Nasal repository, which are to be found in $SG_SRC/nasal/tests: {{gitorious source|proj=fg|repo=hoorays-simgear|view=tree|branch=topics/nasal-standalone|path=simgear/nasal/tests}}


Meanwhile, the build actually works for Windows using the MingW compiler - providing a nasal-bin.exe, which I cannot test currently because I don't have a Windows VM available: http://www.speedyshare.com/MbBTA/download/nasal-bin.exe{{dead link}}
Meanwhile, the build actually works for Windows using the MingW compiler - providing a nasal-bin.exe, which I cannot test currently because I don't have a Windows VM available: http://www.speedyshare.com/MbBTA/download/nasal-bin.exe{{dead link}}


To run it, open a shell (START/EXECUTE cmd/command) and go to the folder of the binary, add a simple Nasal script and run "nasal-bin script.nas", i.e. use one of the scripts in: https://gitorious.org/~hooray/fg/hoorays-simgear/trees/topics/nasal-standalone/simgear/nasal/tests{{dead link}}
To run it, open a shell (START/EXECUTE cmd/command) and go to the folder of the binary, add a simple Nasal script and run "nasal-bin script.nas", i.e. use one of the scripts in: {{gitorious source|proj=fg|repo=hoorays-simgear|view=tree|branch=topics/nasal-standalone|path=simgear/nasal/tests}}


=== Roadmap ===
=== Roadmap ===
Line 81: Line 77:
There's quite a lot of stuff possible in Nasal, that nobody ever used in FG - Philosopher has started writing a bunch of tutorials, for example see: [[Nasal Meta-Programming]]
There's quite a lot of stuff possible in Nasal, that nobody ever used in FG - Philosopher has started writing a bunch of tutorials, for example see: [[Nasal Meta-Programming]]


And you can take a look at some of the scripts in the standalone branch, which support fancy constructs like dependency resolution using import("foo"); but also completely sandboxed/wrapped environments: https://gitorious.org/~hooray/fg/hoorays-simgear/trees/topics/nasal-standalone/simgear/nasal/tests{{dead link}}
And you can take a look at some of the scripts in the standalone branch, which support fancy constructs like dependency resolution using import("foo"); but also completely sandboxed/wrapped environments: {{gitorious source|proj=fg|repo=hoorays-simgear|view=tree|branch=topics/nasal-standalone|path=simgear/nasal/tests}}


These are regression tests developed by the Nasal developer himself, so not true unit testing - but only regression tests for the interpreter itself.
These are regression tests developed by the Nasal developer himself, so not true unit testing - but only regression tests for the interpreter itself.


=== Contributing ===
=== Contributing ===
If possible, new code should be contributed through gitorious, ideally even a branch of FG_ROOT, because that will make it easier to directly integrate such a unit testing system with all the code we got in $FG_ROOT/Nasal.
If possible, new code should be contributed to the maintainers, ideally even a branch of FG_ROOT, because that will make it easier to directly integrate such a unit testing system with all the code we got in $FG_ROOT/Nasal.


== Problem ==
== Problem ==

Navigation menu