Example #1
0
def compileInnoSetUpScript(innoSetupScriptPath):
    (errorCode,
     _) = binaryUtils.callExeWithArguments(__InnoSetupCompilerAbsolutePath,
                                           innoSetupScriptPath, False)
    if (errorCode != 0):
        raise RuntimeError(
            f"Innosetup compiler produced error code {errorCode}.")
Example #2
0
def getPathToLatestMsBuildExe():
    if(not os.path.exists(__VsWherePath)):
        raise FileNotFoundError(
            "Could not find the vswhere.exe used to locate the msbuild.exe under the path. The vswhere.exe was excpected under the path " + __VsWherePath)

    (errorCode, stdOutOfCall) = binaryUtils.callExeWithArguments(__VsWherePath, __ArgumentsForVsWhereToFindMsBuildExe,True)
    if(errorCode != 0):
        raise RuntimeError(f"The vswhere.exe returned error code {errorCode}. StdOut was: {stdOutOfCall}")
    # the array access at the end removes the last character.(called "array slicing")
    # for some reason there is always a \n at the end of the returned path and here we cut that off.
    msBuildPath = stdOutOfCall[:-1 or None]

    if(msBuildPath == __MsBuildNotFoundConstant):
        raise FileNotFoundError(
            "Could not find any installed MSBuild versions")
    return msBuildPath
Example #3
0
def RunUnitTestsOfSolution(solutionPath):
    nunitArguments = __NunitTestRunnerDefaultArguments.format(solutionPath)
    (returnCode,_) = binaryUtils.callExeWithArguments(__NunitConsoleRunnerBinaryPath,nunitArguments,False)
    if (not (returnCode == returnCodes.ExitSuccessCode)):
        raise RuntimeError(f"Test unit runner returned exit code, that was uneqal to the success code. Returned code: {returnCode}")
Example #4
0
def buildWithDefaultReleaseParameters(pathToBuildTarget):
    msBuildPath = msBuildUtils.getPathToLatestMsBuildExe()
    msBuildArguments = f"{__buildConfigParam} {__platformConfigParam} {__cpuConfigParam} {__restoreNugetPackageParam} {__rebuildFlagParam} {pathToBuildTarget}"
    (returnCode,_) = binaryUtils.callExeWithArguments(msBuildPath,msBuildArguments,False)
    if (not (returnCode == returnCodes.ExitSuccessCode)):
        raise RuntimeError(f"Ms build exe returned with error code {returnCode}")
Example #5
0
from makeUtils import binaryUtils
from makeUtils import fileSystemUtils
from makeUtils import returnCodes
from makeUtils import logUtils
import os.path

#TODO: probably locate this with something like vswhere exe?
__vsTestExePath = r"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"
__relativePathToTestDll = r"artifacts\x64\Release\UnitTests.dll"
try:
    baseWorkDirectoryPath = fileSystemUtils.getWorkspaceBaseFolder()
    fullTestDllPath = os.path.join(baseWorkDirectoryPath,__relativePathToTestDll)
    (returnCode,_) = binaryUtils.callExeWithArguments(__vsTestExePath,fullTestDllPath,False)
    exit(returnCode)
except (FileNotFoundError,RuntimeError) as exce:
    logUtils.log("Error in " + os.path.basename(__file__) + ": " + str(exce))
    exit(returnCodes.ExitFailedCode)