diff options
author | Timothy Knight <tknight@google.com> | 2014-07-28 23:26:28 -0700 |
---|---|---|
committer | Timothy Knight <tknight@google.com> | 2014-07-28 23:26:28 -0700 |
commit | 3142076a36c07928534258fb447d80f50735de3a (patch) | |
tree | 2853c4261ecdfd0d1245b26501994f9647386217 /apps | |
parent | 9b8e87de9fa49742573a823b297d2c67128e24a5 (diff) | |
download | pdk-3142076a36c07928534258fb447d80f50735de3a.tar.gz |
CameraITS: Added multi-camera args to test runner script
Change-Id: I0bf4d99bf187c1c2fdd61dae460dab1a88113637
Diffstat (limited to 'apps')
-rw-r--r-- | apps/CameraITS/README | 4 | ||||
-rw-r--r-- | apps/CameraITS/tools/config.py | 15 | ||||
-rwxr-xr-x | apps/CameraITS/tools/run_scene_tests.sh | 45 |
3 files changed, 47 insertions, 17 deletions
diff --git a/apps/CameraITS/README b/apps/CameraITS/README index 0003a36..d0e9f99 100644 --- a/apps/CameraITS/README +++ b/apps/CameraITS/README @@ -217,10 +217,12 @@ The tools/run_scene_tests.sh script can be executed from inside one of the tests/scene<N> folders, and it will simply run each test script in that folder in turn, reporting whether it passed or failed. The scene should be setup as described in the README before running this script. It will create a sub-dir -named "out" where the files created by the various tests will end up.. +named "out" where the files created by the various tests will end up. This +script can take the same "reboot" and "camera" args as the test scripts. cd tests/scene1/ ../../tools/run_scene_tests.sh + ../../tools/run_scene_tests.sh reboot=30 camera=1 The tests/inprog directory contains a mix of unfinished, in-progress, and incomplete tests. These may or may not be useful in testing a HAL impl., diff --git a/apps/CameraITS/tools/config.py b/apps/CameraITS/tools/config.py index 184ef9f..4afcd87 100644 --- a/apps/CameraITS/tools/config.py +++ b/apps/CameraITS/tools/config.py @@ -26,8 +26,8 @@ def main(): python config.py - Measure the target exposure, and cache it. python config.py EXP - Hard-code (and cache) the target exposure. - The "reboot" argument may also be provided, just as with all the test - scripts. + The "reboot" or "reboot=<N>" and "camera=<N>" arguments may also be + provided, just as with all the test scripts. If no exposure value is provided, the camera will be used to measure the scene and set a level that will result in the luma (with linear @@ -39,17 +39,18 @@ def main(): capture a shot reliably). """ - # Command line args, ignoring any "reboot..." args. - non_reboot_argv = [s for s in sys.argv if s[:6] != "reboot"] + # Command line args, ignoring any args that will be passed down to the + # ItsSession constructor (which include "reboot=..." and "camera=..."). + args = [s for s in sys.argv if s[:6] not in ["reboot", "camera"]] - if len(non_reboot_argv) == 1: + if len(args) == 1: with its.device.ItsSession() as cam: # Automatically measure target exposure. its.target.clear_cached_target_exposure() its.target.get_target_exposure(cam) - elif len(non_reboot_argv) == 2: + elif len(args) == 2: # Hard-code the target exposure. - exposure = float(non_reboot_argv[1]) + exposure = float(args[1]) its.target.set_hardcoded_exposure(exposure) else: print "Usage: python %s [EXPOSURE]" diff --git a/apps/CameraITS/tools/run_scene_tests.sh b/apps/CameraITS/tools/run_scene_tests.sh index 8bae5cb..d8527d4 100755 --- a/apps/CameraITS/tools/run_scene_tests.sh +++ b/apps/CameraITS/tools/run_scene_tests.sh @@ -19,13 +19,6 @@ # cleanly on success. # ----------------------------------------------------------------------------- -# Optionally, the device can be rebooted for each test, to ensure that -# a problem in one test doesn't propagate into subsequent tests; use this -# when debugging test failures, but not when running the test suite (since -# all tests should pass even when run back-to-back). -#REBOOT=reboot - -# ----------------------------------------------------------------------------- # This script should be run from inside a tests/scene<N> directory. if [ ! -f ../../tools/config.py ] @@ -34,11 +27,45 @@ then exit fi +# By default, run the tests on the main/rear camera. +CAMERA=0 + +for i in "$@" +do + case $i in + camera=*) + # Run the tests on the specified camera ID. + CAMERA="${i#*=}" + shift + ;; + + reboot) + # Reboot the device prior to running each test, to ensure that a + # problem in one test doesn't propagate into subsequent tests; use this + # when debugging test failures, but not when running the test suite + # (since all tests should pass even when run back-to-back). + REBOOT=reboot + ;; + + reboot=*) + # Reboot and wait the given duration. + REBOOT="reboot=${i#*=}" + shift + ;; + + *) + # Unknown option. + ;; + esac +done + rm -rf out mkdir -p out +echo Running tests with args: $REBOOT camera=$CAMERA + cd out -python ../../../tools/config.py $REBOOT +python ../../../tools/config.py $REBOOT camera=$CAMERA cd .. testcount=0 @@ -52,7 +79,7 @@ do echo "--------------------------------------------------------------------" echo "Running test: $T" echo "--------------------------------------------------------------------" - python ../"$T" $REBOOT + python ../"$T" $REBOOT camera=$CAMERA code=$? if [ $code -ne 0 ]; then let failcount=failcount+1 |