You might want to consider using hostlua:
changelog of trunk including comments / devtalkAs I noted there, I'm working on a more sophisticated emulation environment based on this, which will eventually be added to svn.
Attached is my very very preliminary "emulator".
Currently, it parses the @options, and also allows you to override them using -a=X etc on the command line. Unlike fbonomis approach, it doesn't require a dummy module in the script being tested.
If you make a file tree starting with A/ in the directory where the test is run, chdk file operations will treat this as the camera filesystem (because the host OS will treat A/ as a relative path). llibtest.lua runs, although there are some errors related to using peek to inspect file pointers. On windows, remove() also fails to remove a directory.
The "conf script" stuff will eventually let you load an additional script that customizes the test environment, so for example you could over-ride the key press functions to return a specific sequence of keys, or set a particular propcase to return a sequence of values, or modify the shoot() function so it copies in a CRW or jpeg.
As noted above, this is a very early work in progress, more of a sketch of what I plan to do than anything else.