def _create_build_and_run_list(self):

    def get_overlapping_tests(tests, run_list_names):
        overlapping_tests = []
        for test in tests:
            if (test.name in run_list_names):
                overlapping_tests.append(test)
        return overlapping_tests

    def prune_items(items, marked_items):
        pruned_items = []
        for item in items:
            if (item not in marked_items):
                pruned_items.append(item)
        return pruned_items
    if (self.items == []):
        log.error('No items provided for running this simulation / regression')
        sys.exit(1)
    items_list = self.items
    run_list_names = []
    marked_items = []
    for regression in self.regressions:
        if (regression.name in items_list):
            overlapping_tests = get_overlapping_tests(regression.tests, run_list_names)
            if (overlapping_tests != []):
                log.error('Regression "%s" added for run contains tests that overlap with other regressions added. This can result in conflicting build / run_opts to be set causing unexpected results.', regression.name)
                sys.exit(1)
            self.run_list.extend(regression.tests)
            regression.merge_regression_opts()
            run_list_names.extend(regression.test_names)
            marked_items.append(regression.name)
    items_list = prune_items(items_list, marked_items)
    for test in self.tests:
        if (test.name in items_list):
            overlapping_tests = get_overlapping_tests([test], run_list_names)
            if (overlapping_tests == []):
                self.run_list.append(test)
                run_list_names.append(test.name)
                marked_items.append(test.name)
    items_list = prune_items(items_list, marked_items)
    Tests.merge_global_opts(self.run_list, self.build_opts, self.run_opts)
    if (items_list != []):
        log.error('The items %s added for run were not found in \n%s!\n Use the --list switch to see a list of available tests / regressions.', items_list, self.flow_cfg_file)
    build_list_names = []
    for test in self.run_list:
        if (self.reseed_ovrd is not None):
            test.reseed = self.reseed_ovrd
        test.reseed *= self.reseed_multiplier
        if (test.build_mode.name not in build_list_names):
            self.build_list.append(test.build_mode)
            build_list_names.append(test.build_mode.name)
def _create_build_and_run_list(self):

    def get_overlapping_tests(tests, run_list_names):
        overlapping_tests = []
        for test in tests:
            if (test.name in run_list_names):
                overlapping_tests.append(test)
        return overlapping_tests

    def prune_items(items, marked_items):
        pruned_items = []
        for item in items:
            if (item not in marked_items):
                pruned_items.append(item)
        return pruned_items
    if (self.items == []):
        log.error('No items provided for running this simulation / regression')
        sys.exit(1)
    items_list = self.items
    run_list_names = []
    marked_items = []
    for regression in self.regressions:
        if (regression.name in items_list):
            overlapping_tests = get_overlapping_tests(regression.tests, run_list_names)
            if (overlapping_tests != []):
                log.error('Regression "%s" added for run contains tests that overlap with other regressions added. This can result in conflicting build / run_opts to be set causing unexpected results.', regression.name)
                sys.exit(1)
            self.run_list.extend(regression.tests)
            regression.merge_regression_opts()
            run_list_names.extend(regression.test_names)
            marked_items.append(regression.name)
    items_list = prune_items(items_list, marked_items)
    for test in self.tests:
        if (test.name in items_list):
            overlapping_tests = get_overlapping_tests([test], run_list_names)
            if (overlapping_tests == []):
                self.run_list.append(test)
                run_list_names.append(test.name)
                marked_items.append(test.name)
    items_list = prune_items(items_list, marked_items)
    Tests.merge_global_opts(self.run_list, self.build_opts, self.run_opts)
    if (items_list != []):
        log.error('The items %s added for run were not found in \n%s!\n Use the --list switch to see a list of available tests / regressions.', items_list, self.flow_cfg_file)
    build_list_names = []
    for test in self.run_list:
        if (self.reseed_ovrd is not None):
            test.reseed = self.reseed_ovrd
        test.reseed *= self.reseed_multiplier
        if (test.build_mode.name not in build_list_names):
            self.build_list.append(test.build_mode)
            build_list_names.append(test.build_mode.name)