I'd like to have a collection of scripts that test the different areas that can be tested via script. This should help people making new ports, and also help ensure things don't get broken in code changes.
I've started a general purpose ubasic script, attached below. This currently tests
* tv, sv and ND override
* exposure counter
* shoot/get_shooting
* key input and sending keys to the canon firmware
* sleep and get_tick_count
* print_screen logging
* play/rec + capture mode switching
Only some failures can be detected automatically by the script, others require watching the test run or examining the log output and images.
edit:
updated
fixed keyin goto, increased shoot half delay to 3 sec
edit:
now in svn
http://tools.assembla.com/chdk/browser/trunk/CHDK/SCRIPTS/TEST/ubtest.basUsage:
Start the camera in play mode and run the script. The camera should be aimed at a scene where it can do AE and AF and get a a reasonable image. Script output is logged to CHDK/LOGS/LOG_0001.TXT
If the "interactive" option is set, it will allow you to press some keys and print the key name in response. set ends this section.
Next it tests sending key presses to the canon firmware, by opening the canon menu, pressing up and down, and closing it.
After that, it tries to switch to REC, P mode (called manual on cameras without a true manual) and shoot some pictures with different overrides.
Assuming the exposure counter is working, the number corresponding to each shot is recorded along with what is being tested, so you can see if the resulting images show the expected override effects.
I'd like to have a similar, more extensive test written in lua. Scripts covering the same are in both languages is desirable, since we may create bugs in the interface for a particular language.
Comments and suggestions are welcome. I'll probably add this to that standard CHDK package at some point. I'm particularly interested in ideas for tests where a clear pass/fail can be determined by the script, or easily determined from the resulting image.
Some other existing scripts in the CHDK distribution:
-
http://chdk.wikia.com/wiki/Lua#Lua_library_testVerifies lua libraries, which exercises quite a C library functions as well.
- Setmode
http://chdk.wikia.com/wiki/Lua/Scripts:Standard/Test/Setmodetests modemap and mode switching functions.