firmware_TouchpadMTB: replay gesture event files

After recording the gesture event files, sometimes it is desirable
to adjust the programs or to tune the parameters/weights without
having to record the gesture event files again.

In this patch, we support a new command option '--replay'. With this
option, the programs will read and replay the existent gesture event
files stored in the specified directory, and use the files to derive
a new log file and a new test result file.

Note that only those gesture files specified in the test_conf.py will
be used. Any files in the directory which are not specified in
test_conf.py will be simply ignored.

BUG=chromium-os:35024
TEST=Assume that you have already a test directory 'latest' on a
chromebook machine.
$ DISPLAY=:0 OPTIONS="--replay latest" python main.py
This will replay the gesture event files in the directory, and
generate a new test result file and a new log file in
/var/tmp/touchpad_firmware_test/latest

Change-Id: Ic487dcd00d961b3bc20f46ebf6105df1443f693a
Reviewed-on: https://gerrit.chromium.org/gerrit/44387
Reviewed-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Commit-Queue: Joseph Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
3 files changed