简体   繁体   English

如何仅在TFS服务器上运行32位版本的TestCases

[英]How to run TestCases for 32-Bit build only on TFS server

I have written some Testcases in C# using Microsoft unit test framework and some of the TC needs some drivers to create new Database files. 我已经使用Microsoft单元测试框架在C#中编写了一些测试用例,并且某些TC需要一些驱动程序来创建新的数据库文件。 Now we can install either 32-Bit or 64-Bit driver on one machine. 现在,我们可以在一台计算机上安装32位或64位驱动程序。 Now these TC automatically run for both 32-bit and 64-bit configuration on TFS server, which contains drivers installed for 32-bit only. 现在,这些TC在TFS服务器上自动针对32位和64位配置运行,其中包含仅针对32位安装的驱动程序。 So now for 64-bit build, it is failing and I am unable to checkIn the code. 所以现在对于64位版本,它失败了,我无法检入代码。

Is there any attribute (like TestClass, TestInitialize) or any configuration in the .proj file which we can do so that those TC will run only for 32-build and not for 64-bit. .proj文件中是否可以执行任何属性(如TestClass,TestInitialize)或任何配置,以便这些TC仅在32-build而不是64-bit上运行。

Just try below ways: 只需尝试以下方法:

1.Build the x86 and x64 builds separately, run test for x86 build. 1.分别构建x86和x64构建,对x86构建运行测试。

2.Create .runsettings file and specify <TargetPlatform>x86</TargetPlatform> , then use the .runsettings file for the testing. 2.创建.runsettings文件并指定<TargetPlatform>x86</TargetPlatform> ,然后使用.runsettings文件进行测试。

3.Create two runsettings files, one for x86 and one for x64. 3.创建两个runsettings文件,一个用于x86,一个用于x64。 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>

Reference below articles: 参考以下文章:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ImageList上的32位图像 - 32-bit images on ImageList 简单的C#代码会冻结自身和所有32位应用程序(包括VS2008),但前提是要在带有断点集的调试器下运行 - Simple C# code freezes itself and all 32-bit applications (incl. VS2008) but only if run under a debugger with a breakpoint set 具有许多强制32位的程序集的App - App with many assemblies forcing 32-bit ImageList:32位图像质量下降 - ImageList: 32-bit Images lose quality 32位和64位安装项目 - 32-bit and 64-bit setup projects 什么可能导致64位Vista上的重绘问题,而不是.NET WInForms中的32位重绘问题? - What could cause redraw issues on 64-bit vista but not in 32-bit in .NET WInForms? CopyFromScreen可在32位Win10计算机上运行,​​但不能在64位计算机上运行 - CopyFromScreen works on 32-bit Win10 computer but not 64-bit 将在64位系统上构建的C#中的应用程序与在32位系统上运行的应用程序匹配 - Matching application in C# that built on 64-bit system to running on 32-bit system 将 VS2010 项目从 32 位转换为 64 位时的 LNK2022 - LNK2022 when converting VS2010 project from 32-bit to 64-bit 克服 32 位限制,使用由数百万单位转换的 System.Drawing.Graphics 表面 - Overcoming 32-bit limitations, when using a System.Drawing.Graphics surface translated by millions of units
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM