# Path: workspace_tools/test_exporters.py
# class ReportExporter():
#     CSS_STYLE = """<style>
#                    .name{
#                     border: 1px solid;
#                     border-radius: 25px;
#                     width: 100px;
#                    }
#                    .tooltip{
#                        position:absolute;
#                        background-color: #F5DA81;
#                        display:none;
#                    }
#                    </style>
#                 """
#     JAVASCRIPT = """
#                  <script type="text/javascript">
#                  function show (elem) {
#                      elem.style.display = "block";
#                  }
#                  function hide (elem) {
#                      elem.style.display = "";
#                  }
#                  </script>
#                  """
#         RESULT_COLORS = {'OK': 'LimeGreen',
#                          'FAIL': 'Orange',
#                          'ERROR': 'LightCoral',
#                          'OTHER': 'LightGray',
#                         }
#     def __init__(self, result_exporter_type):
#     def report(self, test_summary_ext, test_suite_properties=None):
#     def report_to_file(self, test_summary_ext, file_name, test_suite_properties=None):
#     def write_to_file(self, report, file_name):
#     def get_tooltip_name(self, toolchain, target, test_id, loop_no):
#     def get_result_div_sections(self, test, test_no):
#     def get_result_tree(self, test_results):
#     def get_all_unique_test_ids(self, test_result_ext):
#     def exporter_html(self, test_result_ext, test_suite_properties=None):
#     def exporter_junit_ioper(self, test_result_ext, test_suite_properties=None):
#     def exporter_junit(self, test_result_ext, test_suite_properties=None):


import sys
    import mbed_lstools
from os.path import join, abspath, dirname
from workspace_tools.utils import check_required_modules
from workspace_tools.build_api import mcu_toolchain_matrix
from workspace_tools.test_api import SingleTestRunner
from workspace_tools.test_api import singletest_in_cli_mode
from workspace_tools.test_api import detect_database_verbose
from workspace_tools.test_api import get_json_data_from_file
from workspace_tools.test_api import get_avail_tests_summary_table
from workspace_tools.test_api import get_default_test_options_parser
from workspace_tools.test_api import print_muts_configuration_from_json
from workspace_tools.test_api import print_test_configuration_from_json
from workspace_tools.test_api import get_autodetected_MUTS_list
from workspace_tools.test_api import get_autodetected_TEST_SPEC
from workspace_tools.test_api import get_module_avail
from workspace_tools.test_exporters import ReportExporter, ResultExporterType
    from workspace_tools.compliance.ioper_runner import IOperTestRunner
    from workspace_tools.compliance.ioper_runner import get_available_oper_test_scopes
                                            platform_filter=opts.general_filter_regex)
        exit(0)

    # Only prints matrix of supported toolchains
    if opts.supported_toolchains:
        print mcu_toolchain_matrix(platform_filter=opts.general_filter_regex)
        exit(0)

    test_spec = None
    MUTs = None

    if hasattr(opts, 'auto_detect') and opts.auto_detect:
        # If auto_detect attribute is present, we assume other auto-detection
        # parameters like 'toolchains_filter' are also set.
        print "MBEDLS: Detecting connected mbed-enabled devices... "

        MUTs = get_autodetected_MUTS_list()

        for mut in MUTs.values():
            print "MBEDLS: Detected %s, port: %s, mounted: %s"% (mut['mcu_unique'] if 'mcu_unique' in mut else mut['mcu'],
                                    mut['port'],
                                    mut['disk'])

        # Set up parameters for test specification filter function (we need to set toolchains per target here)
        use_default_toolchain = 'default' in opts.toolchains_filter.split(',') if opts.toolchains_filter is not None else True
        use_supported_toolchains = 'all' in opts.toolchains_filter.split(',') if opts.toolchains_filter is not None else False
        toolchain_filter = opts.toolchains_filter
        platform_name_filter = opts.general_filter_regex.split(',') if opts.general_filter_regex is not None else opts.general_filter_regex
        # Test specification with information about each target and associated toolchain
        test_spec = get_autodetected_TEST_SPEC(MUTs.values(),

# Path: workspace_tools/test_exporters.py
# class ReportExporter():
#     CSS_STYLE = """<style>
#                    .name{
#                     border: 1px solid;
#                     border-radius: 25px;
#                     width: 100px;
#                    }
#                    .tooltip{
#                        position:absolute;
#                        background-color: #F5DA81;
#                        display:none;
#                    }
#                    </style>
#                 """
#     JAVASCRIPT = """
#                  <script type="text/javascript">
#                  function show (elem) {
#                      elem.style.display = "block";
#                  }
#                  function hide (elem) {
#                      elem.style.display = "";
#                  }
#                  </script>
#                  """
#         RESULT_COLORS = {'OK': 'LimeGreen',
#                          'FAIL': 'Orange',
#                          'ERROR': 'LightCoral',
#                          'OTHER': 'LightGray',
#                         }
#     def __init__(self, result_exporter_type):
#     def report(self, test_summary_ext, test_suite_properties=None):
#     def report_to_file(self, test_summary_ext, file_name, test_suite_properties=None):
#     def write_to_file(self, report, file_name):
#     def get_tooltip_name(self, toolchain, target, test_id, loop_no):
#     def get_result_div_sections(self, test, test_no):
#     def get_result_tree(self, test_results):
#     def get_all_unique_test_ids(self, test_result_ext):
#     def exporter_html(self, test_result_ext, test_suite_properties=None):
#     def exporter_junit_ioper(self, test_result_ext, test_suite_properties=None):
#     def exporter_junit(self, test_result_ext, test_suite_properties=None):


# Path: workspace_tools/singletest.py
import sys
    import mbed_lstools
from os.path import join, abspath, dirname
from workspace_tools.utils import check_required_modules
from workspace_tools.build_api import mcu_toolchain_matrix
from workspace_tools.test_api import SingleTestRunner
from workspace_tools.test_api import singletest_in_cli_mode
from workspace_tools.test_api import detect_database_verbose
from workspace_tools.test_api import get_json_data_from_file
from workspace_tools.test_api import get_avail_tests_summary_table
from workspace_tools.test_api import get_default_test_options_parser
from workspace_tools.test_api import print_muts_configuration_from_json
from workspace_tools.test_api import print_test_configuration_from_json
from workspace_tools.test_api import get_autodetected_MUTS_list
from workspace_tools.test_api import get_autodetected_TEST_SPEC
from workspace_tools.test_api import get_module_avail
from workspace_tools.test_exporters import ReportExporter, ResultExporterType
    from workspace_tools.compliance.ioper_runner import IOperTestRunner
    from workspace_tools.compliance.ioper_runner import get_available_oper_test_scopes

                                            platform_filter=opts.general_filter_regex)
        exit(0)

    # Only prints matrix of supported toolchains
    if opts.supported_toolchains:
        print mcu_toolchain_matrix(platform_filter=opts.general_filter_regex)
        exit(0)

    test_spec = None
    MUTs = None

    if hasattr(opts, 'auto_detect') and opts.auto_detect:
        # If auto_detect attribute is present, we assume other auto-detection
        # parameters like 'toolchains_filter' are also set.
        print "MBEDLS: Detecting connected mbed-enabled devices... "

        MUTs = get_autodetected_MUTS_list()

        for mut in MUTs.values():
            print "MBEDLS: Detected %s, port: %s, mounted: %s"% (mut['mcu_unique'] if 'mcu_unique' in mut else mut['mcu'],
                                    mut['port'],
                                    mut['disk'])

        # Set up parameters for test specification filter function (we need to set toolchains per target here)
        use_default_toolchain = 'default' in opts.toolchains_filter.split(',') if opts.toolchains_filter is not None else True
        use_supported_toolchains = 'all' in opts.toolchains_filter.split(',') if opts.toolchains_filter is not None else False
        toolchain_filter = opts.toolchains_filter
        platform_name_filter = opts.general_filter_regex.split(',') if opts.general_filter_regex is not None else opts.general_filter_regex
        # Test specification with information about each target and associated toolchain
        test_spec = get_autodetected_TEST_SPEC(MUTs.values(),

                                               use_default_toolchain=use_default_toolchain,