Exemplo n.º 1
0
def get_default_options_parser(add_clean=True, add_options=True):
    parser = ArgumentParser()

    targetnames = TARGET_NAMES
    targetnames.sort()
    toolchainlist = list(TOOLCHAINS)
    toolchainlist.sort()

    parser.add_argument(
        "-m",
        "--mcu",
        help="build for the given MCU (%s)" % ', '.join(targetnames),
        metavar="MCU",
        type=argparse_many(argparse_force_uppercase_type(targetnames, "MCU")))

    parser.add_argument(
        "-t",
        "--tool",
        help="build using the given TOOLCHAIN (%s)" % ', '.join(toolchainlist),
        metavar="TOOLCHAIN",
        type=argparse_many(
            argparse_force_uppercase_type(toolchainlist, "toolchain")))

    parser.add_argument("--color",
                        help="print Warnings, and Errors in color",
                        action="store_true",
                        default=False)

    if add_clean:
        parser.add_argument("-c",
                            "--clean",
                            action="store_true",
                            default=False,
                            help="clean the build directory")

    if add_options:
        parser.add_argument(
            "-o",
            "--options",
            action="append",
            help=
            'Add a build argument ("save-asm": save the asm generated by the compiler, "debug-info": generate debugging information, "analyze": run Goanna static code analyzer")',
            type=argparse_lowercase_hyphen_type(
                ['save-asm', 'debug-info', 'analyze'], "build option"))

    return parser
Exemplo n.º 2
0
def get_default_options_parser(add_clean=True, add_options=True):
    parser = ArgumentParser()

    targetnames = TARGET_NAMES
    targetnames.sort()
    toolchainlist = list(TOOLCHAINS)
    toolchainlist.sort()

    parser.add_argument(
        "-m",
        "--mcu",
        help="build for the given MCU (%s)" % ", ".join(targetnames),
        metavar="MCU",
        type=argparse_many(argparse_force_uppercase_type(targetnames, "MCU")),
    )

    parser.add_argument(
        "-t",
        "--tool",
        help="build using the given TOOLCHAIN (%s)" % ", ".join(toolchainlist),
        metavar="TOOLCHAIN",
        type=argparse_many(argparse_force_uppercase_type(toolchainlist, "toolchain")),
    )

    parser.add_argument("--color", help="print Warnings, and Errors in color", action="store_true", default=False)

    if add_clean:
        parser.add_argument("-c", "--clean", action="store_true", default=False, help="clean the build directory")

    if add_options:
        parser.add_argument(
            "-o",
            "--options",
            action="append",
            help='Add a build argument ("save-asm": save the asm generated by the compiler, "debug-info": generate debugging information, "analyze": run Goanna static code analyzer")',
            type=argparse_lowercase_hyphen_type(["save-asm", "debug-info", "analyze"], "build option"),
        )

    return parser
Exemplo n.º 3
0
from tools.build_api import mcu_toolchain_matrix
from tools.build_api import mcu_toolchain_list
from tools.build_api import mcu_target_list
from tools.build_api import merge_build_data
from utils import argparse_filestring_type
from utils import argparse_many
from utils import argparse_dir_not_parent
from tools.toolchains import mbedToolchain, TOOLCHAIN_CLASSES, TOOLCHAIN_PATHS
from tools.settings import CLI_COLOR_MAP

if __name__ == '__main__':
    # Parse Options
    parser = get_default_options_parser(add_app_config=True)
    group = parser.add_mutually_exclusive_group(required=False)
    group.add_argument("-p",
                       type=argparse_many(test_known),
                       dest="program",
                       help="The index of the desired test program: [0-%d]" %
                       (len(TESTS) - 1))

    group.add_argument("-n",
                       type=argparse_many(test_name_known),
                       dest="program",
                       help="The name of the desired test program")

    parser.add_argument(
        "-j",
        "--jobs",
        type=int,
        dest="jobs",
        default=0,
Exemplo n.º 4
0
                            default=None,
                            help="The build (output) directory")

        parser.add_argument(
            "-l",
            "--list",
            action="store_true",
            dest="list",
            default=False,
            help="List (recursively) available tests in order and exit")

        parser.add_argument(
            "-p",
            "--paths",
            dest="paths",
            type=argparse_many(argparse_filestring_type),
            default=None,
            help=
            "Limit the tests to those within the specified comma separated list of paths"
        )

        format_choices = ["list", "json"]
        format_default_choice = "list"
        format_help = "Change the format in which tests are listed. Choices include: %s. Default: %s" % (
            ", ".join(format_choices), format_default_choice)
        parser.add_argument("-f",
                            "--format",
                            dest="format",
                            type=argparse_lowercase_type(
                                format_choices, "format"),
                            default=format_default_choice,
Exemplo n.º 5
0
Arquivo: test.py Projeto: akselsm/mbed
                          dest="jobs",
                          default=0,
                          help="Number of concurrent jobs. Default: 0/auto (based on host machine's number of CPUs)")

        parser.add_argument("--source", dest="source_dir",
                          type=argparse_filestring_type,
                            default=None, help="The source (input) directory (for sources other than tests). Defaults to current directory.", action="append")

        parser.add_argument("--build", dest="build_dir", type=argparse_dir_not_parent(ROOT),
                          default=None, help="The build (output) directory")

        parser.add_argument("-l", "--list", action="store_true", dest="list",
                          default=False, help="List (recursively) available tests in order and exit")

        parser.add_argument("-p", "--paths", dest="paths",
                          type=argparse_many(argparse_filestring_type),
                          default=None, help="Limit the tests to those within the specified comma separated list of paths")

        format_choices = ["list", "json"]
        format_default_choice = "list"
        format_help = "Change the format in which tests are listed. Choices include: %s. Default: %s" % (", ".join(format_choices), format_default_choice)
        parser.add_argument("-f", "--format", dest="format",
                            type=argparse_lowercase_type(format_choices, "format"),
                            default=format_default_choice, help=format_help)
        
        parser.add_argument("--continue-on-build-fail", action="store_true", dest="continue_on_build_fail",
                          default=None, help="Continue trying to build all tests if a build failure occurs")

        #TODO validate the names instead of just passing through str
        parser.add_argument("-n", "--names", dest="names", type=argparse_many(str),
                          default=None, help="Limit the tests to a comma separated list of names")
Exemplo n.º 6
0
from tools.options import get_default_options_parser
from tools.options import extract_profile
from tools.build_api import build_project
from tools.build_api import mcu_toolchain_matrix
from utils import argparse_filestring_type
from utils import argparse_many
from utils import argparse_dir_not_parent
from tools.toolchains import mbedToolchain, TOOLCHAIN_CLASSES, TOOLCHAIN_PATHS
from tools.settings import CLI_COLOR_MAP

if __name__ == '__main__':
    # Parse Options
    parser = get_default_options_parser(add_app_config=True)
    group = parser.add_mutually_exclusive_group(required=False)
    group.add_argument("-p",
                      type=argparse_many(test_known),
                      dest="program",
                      help="The index of the desired test program: [0-%d]" % (len(TESTS)-1))

    group.add_argument("-n",
                       type=argparse_many(test_name_known),
                      dest="program",
                      help="The name of the desired test program")

    parser.add_argument("-j", "--jobs",
                      type=int,
                      dest="jobs",
                      default=0,
                      help="Number of concurrent jobs. Default: 0/auto (based on host machine's number of CPUs)")

    parser.add_argument("-v", "--verbose",
Exemplo n.º 7
0
Arquivo: make.py Projeto: sg-/mbed-os
from tools.build_api import mcu_toolchain_matrix
from tools.build_api import mcu_toolchain_list
from tools.build_api import mcu_target_list
from tools.build_api import merge_build_data
from utils import argparse_filestring_type
from utils import argparse_many
from utils import argparse_dir_not_parent
from tools.toolchains import mbedToolchain, TOOLCHAIN_CLASSES, TOOLCHAIN_PATHS

if __name__ == '__main__':
    # Parse Options
    parser = get_default_options_parser(add_app_config=True)
    group = parser.add_mutually_exclusive_group(required=False)
    group.add_argument(
        "-p",
        type=argparse_many(test_known),
        dest="program",
        help="The index of the desired test program: [0-%d]" % (len(TESTS)-1))

    group.add_argument(
        "-n",
        type=argparse_many(test_name_known),
        dest="program",
        help="The name of the desired test program")

    parser.add_argument(
        "-j", "--jobs",
        type=int,
        dest="jobs",
        default=0,
        help="Number of concurrent jobs. Default: 0/auto (based on host machine's number of CPUs)")
Exemplo n.º 8
0
                          dest="jobs",
                          default=0,
                          help="Number of concurrent jobs. Default: 0/auto (based on host machine's number of CPUs)")

        parser.add_argument("--source", dest="source_dir",
                          type=argparse_filestring_type,
                            default=None, help="The source (input) directory (for sources other than tests). Defaults to current directory.", action="append")

        parser.add_argument("--build", dest="build_dir", type=argparse_dir_not_parent(ROOT),
                          default=None, help="The build (output) directory")

        parser.add_argument("-l", "--list", action="store_true", dest="list",
                          default=False, help="List (recursively) available tests in order and exit")

        parser.add_argument("-p", "--paths", dest="paths",
                          type=argparse_many(argparse_filestring_type),
                          default=None, help="Limit the tests to those within the specified comma separated list of paths")

        format_choices = ["list", "json"]
        format_default_choice = "list"
        format_help = "Change the format in which tests are listed. Choices include: %s. Default: %s" % (", ".join(format_choices), format_default_choice)
        parser.add_argument("-f", "--format", dest="format",
                            type=argparse_lowercase_type(format_choices, "format"),
                            default=format_default_choice, help=format_help)
        
        parser.add_argument("--continue-on-build-fail", action="store_true", dest="continue_on_build_fail",
                          default=None, help="Continue trying to build all tests if a build failure occurs")

        #TODO validate the names instead of just passing through str
        parser.add_argument("-n", "--names", dest="names", type=argparse_many(str),
                          default=None, help="Limit the tests to a comma separated list of names")
Exemplo n.º 9
0
from project_api import setup_project, perform_export, print_results, get_lib_symbols

if __name__ == '__main__':
    # Parse Options
    parser = ArgumentParser()

    targetnames = TARGET_NAMES
    targetnames.sort()
    toolchainlist = EXPORTERS.keys()
    toolchainlist.sort()

    parser.add_argument("-m",
                        "--mcu",
                        metavar="MCU",
                        default='LPC1768',
                        type=argparse_many(
                            argparse_force_uppercase_type(targetnames, "MCU")),
                        help="generate project for the given MCU (%s)" %
                        ', '.join(targetnames))

    parser.add_argument("-i",
                        dest="ide",
                        default='uvision',
                        type=argparse_force_lowercase_type(
                            toolchainlist, "toolchain"),
                        help="The target IDE: %s" % str(toolchainlist))

    parser.add_argument("-c",
                        "--clean",
                        action="store_true",
                        default=False,
                        help="clean the export directory")
Exemplo n.º 10
0


if __name__ == '__main__':
    # Parse Options
    parser = ArgumentParser()

    targetnames = TARGET_NAMES
    targetnames.sort()
    toolchainlist = EXPORTERS.keys()
    toolchainlist.sort()

    parser.add_argument("-m", "--mcu",
                      metavar="MCU",
                      default='LPC1768',
                      type=argparse_many(argparse_force_uppercase_type(targetnames, "MCU")),
                      help="generate project for the given MCU (%s)"% ', '.join(targetnames))

    parser.add_argument("-i",
                      dest="ide",
                      default='uvision',
                      type=argparse_force_lowercase_type(toolchainlist, "toolchain"),
                      help="The target IDE: %s"% str(toolchainlist))

    parser.add_argument("-c", "--clean",
                      action="store_true",
                      default=False,
                      help="clean the export directory")

    group = parser.add_mutually_exclusive_group(required=False)
    group.add_argument("-p",