2
votes

When defining a build in visual studio, you can set up automated tests to run as part of a build. One of the options for an automated test run is the 'Target platform for test execution', as shown below, which allows you to specify the default processor architecture to use when running the tests similar to how you can set this when running tests locally. Image of option in Visual Studio

I am trying to convert a build into the new vNext build system on TFS 2015 and replicate an automated test run using the 'Visual Studio Test' build step. For most things it is relatively simple to duplicate the settings, but there doesn't seem to be anyway to set this option, the result of which is as if this was set to x86 instead of x64 in a XAML based build definition.

The old build definition runs two sets of unit tests, one which has to run with the processor architecture set to x64 for all tests to pass, while the other requires the architecture to be x86 for all its tests to pass but in the old system this was not a problem as it could be forced either way. Is there any way to specify the target architecture in the 'Visual Studio Test' build step that anyone know of?

1

1 Answers

2
votes

You can create two runsettings files, one for x86 and one for x64. You can specify the platform there:

<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
  <!-- Configurations that affect the Test Framework -->
  <RunConfiguration>
    <!-- [x86] | x64  
      - You can also change it from menu Test, Test Settings, Default Processor Architecture -->
    <TargetPlatform>x86</TargetPlatform>
    <!-- Framework35 | [Framework40] | Framework45 -->
    <TargetFrameworkVersion>Framework40</TargetFrameworkVersion>
  </RunConfiguration>
</RunSettings>

Then point the Visual Studio Test step to the correct config file:

enter image description here