From 89f81c29a47172306471d5380beafdec80ac76ee Mon Sep 17 00:00:00 2001 From: Yongqin Liu Date: Mon, 13 Aug 2012 10:53:30 +0800 Subject: support to run more than two instances of the same test with different option at the same time --- build-scripts/post-build-lava.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'build-scripts/post-build-lava.py') diff --git a/build-scripts/post-build-lava.py b/build-scripts/post-build-lava.py index b7acb12..63c3815 100755 --- a/build-scripts/post-build-lava.py +++ b/build-scripts/post-build-lava.py @@ -59,7 +59,16 @@ def gen_lava_android_test_actions(tests=[]): actions = [] if len(tests) == 0: return actions - test_actions = [test for test in tests if test != REBOOT_TOKEN] + test_actions = [] + for test in tests: + if test == REBOOT_TOKEN: + continue + if test.find('(') >= 0\ + and test.rfind(')') > test.find('('): + test = test[:test.find('(')].strip() + if not test: + continue + test_actions.append(test) if len(test_actions) > 0: inst_action = { @@ -72,9 +81,18 @@ def gen_lava_android_test_actions(tests=[]): actions.append(inst_action) for test in tests: + + test_option = '' + if test.find('(') >= 0 and test.rfind(')') > test.find('(') \ + and test[:test.find('(')].strip(): + test = test[:test.find('(')].strip() + test_option = test[test.find('(') + 1 : test.rfind(')')] + parameters = {'test_name': test} - test_option = os.environ.get('%s%s' % (test.upper(), OPTION_SUFFIX)) + if not test_option: + test_option = os.environ.get('%s%s' % (test.upper(), OPTION_SUFFIX)) + if test_option: parameters['option'] = test_option -- cgit v1.2.3 From 2555919e1044e6b1d396fef99da8415fb06cb5d0 Mon Sep 17 00:00:00 2001 From: Yongqin Liu Date: Mon, 13 Aug 2012 11:20:19 +0800 Subject: fix the problem that generate wrong option for test --- build-scripts/post-build-lava.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'build-scripts/post-build-lava.py') diff --git a/build-scripts/post-build-lava.py b/build-scripts/post-build-lava.py index 63c3815..bf09de1 100755 --- a/build-scripts/post-build-lava.py +++ b/build-scripts/post-build-lava.py @@ -85,8 +85,8 @@ def gen_lava_android_test_actions(tests=[]): test_option = '' if test.find('(') >= 0 and test.rfind(')') > test.find('(') \ and test[:test.find('(')].strip(): - test = test[:test.find('(')].strip() test_option = test[test.find('(') + 1 : test.rfind(')')] + test = test[:test.find('(')].strip() parameters = {'test_name': test} -- cgit v1.2.3 From 269294e9ab7bcb2ccab1fa25a960e6218b090028 Mon Sep 17 00:00:00 2001 From: Yongqin Liu Date: Mon, 13 Aug 2012 13:32:23 +0800 Subject: add some comment --- build-scripts/post-build-lava.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'build-scripts/post-build-lava.py') diff --git a/build-scripts/post-build-lava.py b/build-scripts/post-build-lava.py index bf09de1..972088f 100755 --- a/build-scripts/post-build-lava.py +++ b/build-scripts/post-build-lava.py @@ -63,6 +63,7 @@ def gen_lava_android_test_actions(tests=[]): for test in tests: if test == REBOOT_TOKEN: continue + ## support for test that specified with option like methanol,methanol(DEFAULT) if test.find('(') >= 0\ and test.rfind(')') > test.find('('): test = test[:test.find('(')].strip() @@ -82,6 +83,8 @@ def gen_lava_android_test_actions(tests=[]): for test in tests: + ## support for test that specified with option like methanol,methanol(DEFAULT) + ## for this case, get the option from the test test_option = '' if test.find('(') >= 0 and test.rfind(')') > test.find('(') \ and test[:test.find('(')].strip(): -- cgit v1.2.3