firmware_TouchMTB: add a new command option --show_spec_v2

In this patch, we add a new command line option --show_spec_v2
which shows the test results derived with the validators
described in the touchpad firmware test spec v2.

BUG=chromium:248120
TEST=None. Will be tested with subsequent patches.

Change-Id: I14caf11d2cffe8e5dfae659d2606030e0346ec47
Reviewed-on: https://gerrit.chromium.org/gerrit/58081
Reviewed-by: Charlie Mooney <charliemooney@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Commit-Queue: Joseph Shyh-In Hwang <josephsih@chromium.org>
diff --git a/client/site_tests/firmware_TouchMTB/firmware_constants.py b/client/site_tests/firmware_TouchMTB/firmware_constants.py
index 8ff6664..70a7481 100644
--- a/client/site_tests/firmware_TouchMTB/firmware_constants.py
+++ b/client/site_tests/firmware_TouchMTB/firmware_constants.py
@@ -145,6 +145,7 @@
 OPTIONS.MODE = 'mode'
 OPTIONS.REPLAY = 'replay'
 OPTIONS.RESUME = 'resume'
+OPTIONS.SHOW_SPEC_V2 = 'show_spec_v2'
 OPTIONS.SIMPLIFIED = 'simplified'
 OPTIONS.SKIP_HTML = 'skip_html'
 OPTIONS.TOUCHSCREEN = 'touchscreen'
diff --git a/client/site_tests/firmware_TouchMTB/main.py b/client/site_tests/firmware_TouchMTB/main.py
index 87c5baa..fafd502 100644
--- a/client/site_tests/firmware_TouchMTB/main.py
+++ b/client/site_tests/firmware_TouchMTB/main.py
@@ -216,6 +216,8 @@
     print '            robot: using robot to perform gestures automatically'
     print '            robot_int: using robot with finger interaction'
     print '            robot_sim: robot simulation, for developer only'
+    print '  --%s' % OPTIONS.SHOW_SPEC_V2
+    print '        Show the results derived with the validator spec v2.'
     print '  --%s log_dir' % OPTIONS.REPLAY
     print '        Replay the gesture files and get the test results.'
     print '        log_dir is a log sub-directory in %s' % conf.log_root_dir
@@ -250,6 +252,9 @@
                                                            example_log_dir)
     print '  $ DISPLAY=:0 OPTIONS="--resume %s" python main.py\n' % \
             example_log_dir
+    print '  # Show the results derived with the new validator spec.'
+    print '  $ DISPLAY=:0 OPTIONS="--show_spec_v2" python main.py\n'
+
     sys.exit(1)
 
 
@@ -270,6 +275,7 @@
                OPTIONS.MODE: MODE.MANUAL,
                OPTIONS.REPLAY: None,
                OPTIONS.RESUME: None,
+               OPTIONS.SHOW_SPEC_V2: False,
                OPTIONS.SIMPLIFIED: False,
                OPTIONS.SKIP_HTML: False,
                OPTIONS.TOUCHSCREEN: False}
@@ -287,6 +293,7 @@
                     OPTIONS.MODE + '=',
                     OPTIONS.REPLAY + '=',
                     OPTIONS.RESUME + '=',
+                    OPTIONS.SHOW_SPEC_V2,
                     OPTIONS.SIMPLIFIED,
                     OPTIONS.SKIP_HTML,
                     OPTIONS.TOUCHSCREEN]
@@ -317,9 +324,11 @@
             else:
                 print 'Error: the log directory "%s" does not exist.' % log_dir
                 _usage_and_exit()
+        elif opt in ('--%s' % OPTIONS.SHOW_SPEC_V2,):
+            options[OPTIONS.SHOW_SPEC_V2] = True
         elif opt in ('-s', '--%s' % OPTIONS.SIMPLIFIED):
             options[OPTIONS.SIMPLIFIED] = True
-        elif opt in ('--%s' % OPTIONS.SKIP_HTML):
+        elif opt in ('--%s' % OPTIONS.SKIP_HTML,):
             options[OPTIONS.SKIP_HTML] = True
         elif opt in ('-t', '--%s' % OPTIONS.TOUCHSCREEN):
             options[OPTIONS.TOUCHSCREEN] = True