diff options
Diffstat (limited to 'func/args_handler.py')
-rw-r--r-- | func/args_handler.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/func/args_handler.py b/func/args_handler.py index 57ecfcbd..90d902b6 100644 --- a/func/args_handler.py +++ b/func/args_handler.py @@ -7,19 +7,23 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## import os +from operator import add +import simplejson as json from func.env_setup import Env_setup from func.spawn_vm import SpawnVM from func.driver import Driver -def get_files_in_test_list(suit_name): - with open('test_list/' + suit_name, 'r') as fin_put: - benchmark_list = fin_put.readlines() - return map(lambda x: x.rstrip(), benchmark_list) +def get_files_in_test_list(suit_name, case_type='all'): + benchmark_list = json.load(file('test_list/{0}'.format(suit_name))) + return reduce(add, benchmark_list.values()) \ + if case_type == 'all' else benchmark_list[case_type] -def get_files_in_test_case(lab, suit_name): - return os.listdir('./test_cases/{0}/{1}'.format(lab, suit_name)) +def get_files_in_test_case(lab, suit_name, case_type='all'): + test_case_all = os.listdir('./test_cases/{0}/{1}'.format(lab, suit_name)) + return test_case_all if case_type == 'all' else \ + filter(lambda x: case_type in x, test_case_all) def get_benchmark_path(lab, suit, benchmark): |