Ejemplo n.º 1
0
    def test_build_solution(self):
        self.setupStep(
            vstudio.MsBuild141(projectfile='pf', config='cfg', platform='x64'))

        self.expectCommands(
            ExpectShell(
                workdir='wkdir',
                command=
                'FOR /F "tokens=*" %%I in (\'vswhere.exe -property  installationPath\')"  do "%%I\\%VCENV_BAT%" x86 && msbuild "pf" /p:Configuration="cfg" /p:Platform="x64" /maxcpucount /t:Rebuild',  # noqa pylint: disable=line-too-long
                env={
                    'VCENV_BAT':
                    r'\VC\Auxiliary\Build\vcvarsall.bat',
                    'PATH':
                    'C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\;${PATH};'
                })  # noqa pylint: disable=line-too-long
            + 0)
        self.expectOutcome(result=SUCCESS,
                           state_string="compile 0 projects 0 files")
        return self.runStep()
Ejemplo n.º 2
0
    def test_rebuild_project_with_defines(self):
        self.setup_step(
            vstudio.MsBuild141(projectfile='pf',
                               config='cfg',
                               platform='Win32',
                               project='pj',
                               defines=['Define1', 'Define2=42']))

        self.expect_commands(
            ExpectShell(
                workdir='wkdir',
                command=
                'FOR /F "tokens=*" %%I in (\'vswhere.exe -property  installationPath\')  do "%%I\\%VCENV_BAT%" x86 && msbuild "pf" /p:Configuration="cfg" /p:Platform="Win32" /maxcpucount /t:"pj" /p:DefineConstants="Define1;Define2=42"',  # noqa pylint: disable=line-too-long
                env={
                    'VCENV_BAT':
                    r'\VC\Auxiliary\Build\vcvarsall.bat',
                    'PATH':
                    'C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\;${PATH};'
                })  # noqa pylint: disable=line-too-long
            .exit(0))
        self.expect_outcome(result=SUCCESS,
                            state_string="compile 0 projects 0 files")
        return self.run_step()