自己的C ++ VSIX测试适配器在x64平台上不起作用 [英] Own VSIX test adapter for C++ does not work under x64 platform

查看:54
本文介绍了自己的C ++ VSIX测试适配器在x64平台上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们为C ++编写了自己的测试适配器.这对于使用win32平台的解决方案非常有效.

但如今,我们仅部署x64平台.

我们的测试适配器包含三个项目:

  1. C#项目包含ITestDiscoverer和ITestExecutor的实现
  2. C ++/CLI项目正在执行    发现和执行测试的工作.

如您在下面的代码示例中所见,DiscoverTests从C ++类DiscoverECPPTests调用FindAllETests(…). /p>

FindAllETests(…)进行了呼叫 :: LoadLibrary(testdll).

执行测试时也会发生同样的情况.

问题是无法打开 x64测试dll.

Visual Studio是平台Win32. C ++/CLI项目也是Win32.

有人对如何解决此问题有任何建议吗?

谢谢

 发现者的代码示例:

使用System.Collections.Generic;
.
.
.

使用CliCommunicatorETestFramework;
 
名称空间&nativeTestAdapter
{
    [DefaultExecutorUri(ETestExecutor.ExecutorUriString)]
    [FileExtension(.etx"))
   公共类  ETestDiscoverer :ITestDiscoverer
    {

        void  DiscoverTests(IEnumerable< string>  sources,  IDiscoveryContext   
        {
                                      
                 oTestDiscoverer  = &nbs; ExecEC
          < List< TestCase>  tests  = >
 
          oTestDiscoverer.FindAllETests(源,测试,true记录器)
 
         // 发送所有测试来发现
            (测试案例中的TestCase测试)
                        .
                 discoverySink.SendTestCase(test);
           }
       }
   }
} 


解决方案

PeterBun,

感谢您在MSDN论坛中发帖.

实际上,自定义测试适配器问题确实超出了该论坛的 支持范围.

如下面的代码示例所示,DiscoverTests从C ++类DiscoverECPPTests调用FindAllETests(…).

FindAllETests(…)调用:: LoadLibrary(testdll).

执行测试时也会发生同样的情况.

问题是无法打开x64测试dll.

Visual Studio是平台Win32. C ++/CLI项目也是Win32.

有人对解决此问题有任何建议吗?

也许您可以检查它是否与TestX64.dll文件有关.

参考:

http://social.msdn.microsoft.com/Forums/vstudio /en-US/home?forum = vsx

或者您可以在此处提交用户声音:

http://visualstudio.uservoice.com/forums/121579-visual-studio . Visual Studio产品团队正在那里聆听用户的声音.

如果有任何疑问,请随时告诉我.

最好的问候


We wrote an own test adapter for C++. This works well for solutions with platform win32.

But nowadays we only deploy platform x64.

Our test adapter contains three projects:

  1. VSIX  project
  2. C# project contains  implementation of ITestDiscoverer and ITestExecutor
  3. C++/CLI project doing the      work of discovering and executing tests.

As you can see in the code sample below DiscoverTests calls FindAllETests(…) from C++ class DiscoverECPPTests.

FindAllETests(…) makes a call of ::LoadLibrary( testdll).

The same happens when executing tests.

The problem is that it is not possible to open a  x64 test dll.

Visual Studio is platform Win32. The C++/CLI project is Win32 too.

Does anyone have any suggestions on how to fix this problem?

Thank You

Code sample for discoverer:

using System.Collections.Generic;
.
.
.

using CliCommunicatorETestFramework;
 
namespace ENativeTestAdapter
{
    [DefaultExecutorUri(ETestExecutor.ExecutorUriString)]
    [FileExtension(".etx")]
    public class ETestDiscoverer : ITestDiscoverer
    {

        public void DiscoverTests(IEnumerable<string> sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink)
        {
            
            DiscoverECPPTests oTestDiscoverer = new DiscoverECPPTests(ETestExecutor.ExecutorUriString);
            List<TestCase> tests = new List<TestCase>();
 
            oTestDiscoverer.FindAllETests(sources, tests, logger, true);
 
            // send all test to discovery sink
            foreach (TestCase test in tests)
            {
                discoverySink.SendTestCase(test);
            }
        }
    }
}


解决方案

Hi PeterBun,

Thank you for posting in the MSDN forum.

Actually the custom test adapter issue is really out of support range of this forum.

As you can see in the code sample below DiscoverTests calls FindAllETests(…) from C++ class DiscoverECPPTests.

FindAllETests(…) makes a call of ::LoadLibrary( testdll).

The same happens when executing tests.

The problem is that it is not possible to open a  x64 test dll.

Visual Studio is platform Win32. The C++/CLI project is Win32 too.

Does anyone have any suggestions on how to fix this problem?

Maybe you could check whether it is related to the TestX64.dll file.

Reference:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/0112ae3e-f0b2-43ab-a9e9-5ef3cde44598/how-can-i-rigth-configure-to-run-native-c-unit-tests-on-multiplatform-tfs-2012-server-build?forum=tfsbuild

Since it is related to the custom extension, one idea is that you could post this issue to the

http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vsx

Or you could submit a user voice here:

http://visualstudio.uservoice.com/forums/121579-visual-studio. The Visual Studio product team is listening to user voice there.

If there's any concern, please feel free to let me know.

Best Regards,


这篇关于自己的C ++ VSIX测试适配器在x64平台上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆