Exemplo n.º 1
0
def actionRunUnitTests():
    """
    Run all specified unit tests.
  """
    UnitTestRunner.init()

    for target in Settings.targets:
        for platform in Settings.targetPlatforms:
            for cpu in Settings.targetCPUs:
                for configuration in Settings.targetConfigurations:
                    if not Summary.checkIfActionFailed(ACTION_BUILD, target,
                                                       platform, cpu,
                                                       configuration):
                        Logger.printStartActionMessage(
                            'Running unit tests for ' + target + ' ' +
                            platform + ' ' + cpu + ' ' + configuration,
                            ColoredFormatter.YELLOW)
                        result = UnitTestRunner.run(target, platform, cpu,
                                                    configuration)
                        Summary.addSummary(ACTION_RUN_UNITTESTS, target,
                                           platform, cpu, configuration,
                                           result,
                                           UnitTestRunner.executionTime)
                        if result != NO_ERROR:
                            Logger.printEndActionMessage(
                                'Failed to execute unit tests!')
                        else:
                            Logger.printEndActionMessage(
                                'Executed all unit tests')
Exemplo n.º 2
0
def actionBuild():
    """
    Build all specified targets for all specified platforms.
  """

    #Init builder logger
    Builder.init()

    for target in Settings.targets:
        targetsToBuild, combineLibs, copyToOutput = Builder.getTargetGnPath(
            target)
        for platform in Settings.targetPlatforms:
            for cpu in Settings.targetCPUs:
                if System.checkIfCPUIsSupportedForPlatform(cpu, platform):
                    for configuration in Settings.targetConfigurations:
                        if not Summary.checkIfActionFailed(
                                ACTION_PREPARE, target, platform, cpu,
                                configuration):
                            Logger.printStartActionMessage(
                                'Build ' + target + ' ' + platform + ' ' +
                                cpu + ' ' + configuration,
                                ColoredFormatter.YELLOW)
                            result = Builder.run(target, targetsToBuild,
                                                 platform, cpu, configuration,
                                                 combineLibs, copyToOutput)
                            Summary.addSummary(ACTION_BUILD, target, platform,
                                               cpu, configuration, result,
                                               Builder.executionTime)
                            if result != NO_ERROR:
                                Logger.printEndActionMessage(
                                    'Failed building ' + target + ' ' +
                                    platform + ' ' + cpu + ' ' + configuration,
                                    ColoredFormatter.RED)
                                #Terminate script execution if stopExecutionOnError is set to True in userdef
                                shouldEndOnError(result)
                            else:
                                Logger.printEndActionMessage('Build ' +
                                                             target + ' ' +
                                                             platform + ' ' +
                                                             cpu + ' ' +
                                                             configuration)
                        else:
                            Logger.printColorMessage(
                                'Build cannot run because preparation has failed for '
                                + target + ' ' + platform + ' ' + cpu + ' ' +
                                configuration, ColoredFormatter.YELLOW)
                            Logger.printEndActionMessage(
                                'Build not run for ' + target + ' ' +
                                platform + ' ' + cpu + ' ' + configuration,
                                ColoredFormatter.YELLOW)
Exemplo n.º 3
0
def actionPrepare():
    """
    Prepare dev environment for all specified targets and platforms.
  """

    #Do preparation that is common for all platforms. Pass true if ortc is one of targets
    result = Preparation.setUp('ortc' in Settings.targets)
    if result != NO_ERROR:
        #Terminate execution, because prepration common for all targets and platforms has failed.
        System.stopExecution(result)

    for target in Settings.targets:
        for platform in Settings.targetPlatforms:
            for cpu in Settings.targetCPUs:
                if System.checkIfCPUIsSupportedForPlatform(cpu, platform):
                    for configuration in Settings.targetConfigurations:
                        Logger.printStartActionMessage(
                            'Prepare ' + target + ' ' + platform + ' ' + cpu +
                            ' ' + configuration, ColoredFormatter.YELLOW)
                        result = Preparation.run(target, platform, cpu,
                                                 configuration)
                        Summary.addSummary(ACTION_PREPARE, target, platform,
                                           cpu, configuration, result,
                                           Preparation.executionTime)
                        if result != NO_ERROR:
                            Logger.printEndActionMessage(
                                'Failed preparing ' + target + ' ' + platform +
                                ' ' + cpu + ' ' + configuration,
                                ColoredFormatter.RED)
                            #Terminate script execution if stopExecutionOnError is set to True in userdef
                            shouldEndOnError(result)
                        else:
                            Logger.printEndActionMessage('Prepare ' + target +
                                                         ' ' + platform + ' ' +
                                                         cpu + ' ' +
                                                         configuration)