Running native VS2012/C++ 64-bit unit tests from command line - c++

I'm attempting to run unit tests from the command line. I tried using the mstest.exe program using the following command:
E:\VS Projects\...\>"C:\Program Files (x86)\Microsoft Visual Studio 11.0\
Common7\IDE\MSTest.exe" /testcontainer:mytest.dll
/testsettings:"E:\VS Projects\...\Local.testsettings"
The mstest program responce was:
Microsoft (R) Test Execution Command Line Tool Version 11.0.50727.1
Copyright (c) Microsoft Corporation. All rights reserved.
Loading E:\VS Projects\...\Local.testsettings...
Loading mytest.dll...
mytest.dll
Unable to load the test container 'mytest.dll' or one of its
dependencies. If you build your test project assembly as a 64 bit assembly,
it cannot be loaded. When you build your test project assembly, select "Any
CPU" for the platform. To run your tests in 64 bit mode on a 64 bit
processor, you must change your test settings in the Hosts tab to run your
tests in a 32 bit process. Error details: Could not load file or assembly
'file:///E:\VS Projects\...\mytest.dll' or one of its dependencies. The
module was expected to contain an assembly manifest.
Local.testsettings does include information, that the tests shall be run in 64-bit environment.
I can guess, that mstest expects an assembly instead of native test project and this is why it fails. If so, how can I run native tests from the command line? In the other case, how shall I configure the mstest to work properly?

Thanks for Hans Passant for guidance.
The solution is to use:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe

Another option is to install Catch2 which allows you to run the unit testing project as an exe from the command prompt and display the results:
https://github.com/catchorg/Catch2
C:\Projects\T9Predict\T9PredictTests\Debug\> T2PredictTests.exe
T2PredictTests.exe
C:\Projects\T9Predict\T9PredictTests\T2PredictTests.cpp(33): FAILED!
REQUIRE( result[0] == "hello" )
with expansion:
"" == "hello
===============================================================================
test cases: 2 | 1 passed | 1 failed
assertions: 2 | 1 passed | 1 failed

Related

Keep getting warning MSB3245 on dotnet build

I keep getting this error when i try to use Azure Pipelines.
I am running this on the Hosted VS2017 pool.
Here is the pipeline i constructed:
The error i keep getting is displayed in the following logs:
2019-04-30T12:13:03.1506572Z =============================================================================
2019-04-30T12:13:03.1506616Z Task : .NET Core
2019-04-30T12:13:03.1506659Z Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command. For package commands, supports NuGet.org and authenticated feeds like Package Management and MyGet.
2019-04-30T12:13:03.1506705Z Version : 2.150.1
2019-04-30T12:13:03.1506734Z Author : Microsoft Corporation
2019-04-30T12:13:03.1506782Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2019-04-30T12:13:03.1506811Z ==============================================================================
2019-04-30T12:13:03.7965121Z [command]C:\windows\system32\chcp.com 65001
2019-04-30T12:13:03.8059420Z Active code page: 65001
2019-04-30T12:13:03.8489997Z [command]"C:\Program Files\dotnet\dotnet.exe" build D:\a\1\s\SLDatatHighway.Tests\SLDatatHighway.Tests.csproj
2019-04-30T12:13:04.1500736Z Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
2019-04-30T12:13:04.1501599Z Copyright (C) Microsoft Corporation. All rights reserved.
2019-04-30T12:13:04.1501793Z
2019-04-30T12:13:04.8585498Z Restoring packages for D:\a\1\s\SLDatatHighway.Tests\SLDatatHighway.Tests.csproj...
2019-04-30T12:13:05.0444966Z Restore completed in 185.75 ms for D:\a\1\s\SLDatatHighway.Tests\SLDatatHighway.Tests.csproj.
2019-04-30T12:13:07.0489863Z SLDatatHighway.Tests -> D:\a\1\s\SLDatatHighway.Tests\bin\Debug\netstandard2.0\SLDatatHighway.Tests.dll
2019-04-30T12:13:07.0572034Z
2019-04-30T12:13:07.0572433Z Build succeeded.
2019-04-30T12:13:07.0572907Z 0 Warning(s)
2019-04-30T12:13:07.0573263Z 0 Error(s)
2019-04-30T12:13:07.0573380Z
2019-04-30T12:13:07.0573422Z Time Elapsed 00:00:02.84
2019-04-30T12:13:07.0915364Z [command]"C:\Program Files\dotnet\dotnet.exe" build D:\a\1\s\SL_DataHighway.Tests\SL_DataHighway.Tests.csproj
2019-04-30T12:13:07.3764095Z Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
2019-04-30T12:13:07.3807448Z Copyright (C) Microsoft Corporation. All rights reserved.
2019-04-30T12:13:07.3807518Z
2019-04-30T12:13:08.1015074Z Restoring packages for D:\a\1\s\SL_DataHighway.Tests\SL_DataHighway.Tests.csproj...
2019-04-30T12:13:08.7878736Z Restore completed in 484.69 ms for D:\a\1\s\SL_DataHighway.Tests\SL_DataHighway.Tests.csproj.
2019-04-30T12:13:14.0395526Z SL_DataHighway.Tests -> D:\a\1\s\SL_DataHighway.Tests\bin\Debug\netcoreapp2.1\SL_DataHighway.Tests.dll
2019-04-30T12:13:14.0481411Z
2019-04-30T12:13:14.0482045Z Build succeeded.
2019-04-30T12:13:14.0483401Z 0 Warning(s)
2019-04-30T12:13:14.0483487Z 0 Error(s)
2019-04-30T12:13:14.0483908Z
2019-04-30T12:13:14.0484034Z Time Elapsed 00:00:06.60
2019-04-30T12:13:14.0864499Z [command]"C:\Program Files\dotnet\dotnet.exe" build D:\a\1\s\SL_Data_Highway_App\SL_Data_Highway_App.csproj
2019-04-30T12:13:14.3705111Z Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
2019-04-30T12:13:14.3705588Z Copyright (C) Microsoft Corporation. All rights reserved.
2019-04-30T12:13:14.3705720Z
2019-04-30T12:13:14.8626284Z Nothing to do. None of the projects specified contain packages to restore.
2019-04-30T12:13:15.3736897Z C:\Program Files\dotnet\sdk\2.2.105\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\1\s\SL_Data_Highway_App\SL_Data_Highway_App.csproj]
2019-04-30T12:13:15.3779682Z C:\Program Files\dotnet\sdk\2.2.105\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\1\s\SL_Data_Highway_App\SL_Data_Highway_App.csproj]
2019-04-30T12:13:15.4465770Z C:\Program Files\dotnet\sdk\2.2.105\Microsoft.Common.CurrentVersion.targets(2729,5): error MSB4062: The "Microsoft.Build.Tasks.ResolveComReference" task could not be loaded from the assembly Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [D:\a\1\s\SL_Data_Highway_App\SL_Data_Highway_App.csproj]
2019-04-30T12:13:15.4550056Z
2019-04-30T12:13:15.4554234Z Build FAILED.
2019-04-30T12:13:15.4554556Z
2019-04-30T12:13:15.4574427Z C:\Program Files\dotnet\sdk\2.2.105\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\1\s\SL_Data_Highway_App\SL_Data_Highway_App.csproj]
2019-04-30T12:13:15.4579425Z C:\Program Files\dotnet\sdk\2.2.105\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\1\s\SL_Data_Highway_App\SL_Data_Highway_App.csproj]
2019-04-30T12:13:15.4580177Z C:\Program Files\dotnet\sdk\2.2.105\Microsoft.Common.CurrentVersion.targets(2729,5): error MSB4062: The "Microsoft.Build.Tasks.ResolveComReference" task could not be loaded from the assembly Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [D:\a\1\s\SL_Data_Highway_App\SL_Data_Highway_App.csproj]
2019-04-30T12:13:15.4583312Z 2 Warning(s)
2019-04-30T12:13:15.4583865Z 1 Error(s)
2019-04-30T12:13:15.4585281Z
2019-04-30T12:13:15.4585654Z Time Elapsed 00:00:01.01
2019-04-30T12:13:15.4950879Z ##[error]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1
2019-04-30T12:13:15.4960391Z ##[error]Dotnet command failed with non-zero exit code on the following projects : D:\a\1\s\SL_Data_Highway_App\SL_Data_Highway_App.csproj
2019-04-30T12:13:15.4994396Z ##[section]Finishing: dotnet build
2019-04-30T12:13:15.5009622Z ##[section]Starting: Checkout
2019-04-30T12:13:15.5109587Z ==============================================================================
2019-04-30T12:13:15.5109634Z Task : Get sources
2019-04-30T12:13:15.5109671Z Description : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2019-04-30T12:13:15.5109870Z Version : 1.0.0
2019-04-30T12:13:15.5109906Z Author : Microsoft
2019-04-30T12:13:15.5109940Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2019-04-30T12:13:15.5109992Z ==============================================================================
2019-04-30T12:13:15.9176300Z Cleaning any cached credential from repository: SL-DataHighway (Git)
2019-04-30T12:13:15.9266683Z ##[section]Finishing: Checkout
2019-04-30T12:13:15.9371889Z ##[section]Starting: Finalize Job
2019-04-30T12:13:15.9414810Z Start cleaning up orphan processes.
2019-04-30T12:13:15.9425504Z ##[section]Finishing: Finalize Job
2019-04-30T12:13:15.9475730Z ##[section]Finishing: Job
Building via Visual Studio 2017 works fine. Problem is only when I try to build via an Azure Pipeline.
Is there something I am missing or did I import something wrong?
Here is an overview of the references in my project. As you can see the Outlook Interop is referenced fine as well as the Office reference.
My packages.config file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Office.Interop.Outlook" version="15.0.4797.1003" targetFramework="net461" />
</packages>
Thank you in advance!
EDIT: Added pool, Added overview of packages.config

TFS 2017 Build Fails - can't publish test results

TFS 2017 Build is failing on the Visual Studio Test task when it tries to publish tests result. Using task version 2.* ... version 1.* was not working anymore (couldn't find path vstest.console.exe and acted strange when I put specific path)... how can I get this to work? using tfs 2017.5 on the build server, and TFS Version 15.117.26714.0, using the latest agent from that.
2017-09-21T20:29:13.5158841Z Results File: D:\agent1_work\1\s\Dev\20170305_MD_4.4\TestResults\TfsService_DEVBUILD5 2017-09-21 15_14_33.trx
2017-09-21T20:29:14.5470386Z ##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
2017-09-21T20:29:14.5470386Z ##[error]Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe failed with return code: 1
2017-09-21T20:29:17.9532729Z ##[warning]Failed to publish test results: '', hexadecimal value 0x10, is an invalid character. Line 10256, position 10.
2017-09-21T20:29:17.9532729Z ##[error]Vstest exited with return code: 1.
OK found an answer, have to use a newer version of vstest.console.exe provided by the TFS tasks team. see last item here:
https://github.com/Microsoft/vstest/issues/683
basically, need pass custom vstest.console.exe path which is VS-Insallation-Directory\Common7\IDE\Extensions\TestPlatform\vstest.console.exe in your vstest V2 task.

MSTest C++ unit test dll not working

C# Unit Test - Runs ok
I have read the MSTest unit test (utterly useless )documentation on the microsoft website here: utterly-useless-ms-doc-link. Then I read a whole load of other more useful links (e.g. on SO) and finally I am able to run C# unit tests no problems, like this:
mstest /testcontainer:UnitTest.dll /detail:errormessage
C++ Unit Test - Fails
As far as I can tell this should be the same for the C++ unit tests, so I ran a similar command (specific command details at the end) for C++, but then I get the error:
UnitTest_TrackManager.dll Unable to load the test container
'UnitTest_TrackManager.dll' or one of its dependencies. If you build
your test project assembly as a 64 bit assembly, it cannot be loaded.
When you build your test project assembly, select "Any CPU" for the
platform. To run your tests in 64 bit mode on a 64 bit processor, you
must change your test settings in the Hosts tab to run your tests in a
32 bit process. Error details: Could not load file or assembly
'file:///D:\MiddlewareTest01\x64\Debug\UnitTest_TrackManager.dll'
or one of its dependencies. The module was expected to contain an
assembly manifest.
32-bit or 64-bit DLL?
So, fair enough, I have built the code for 64 bit and MStest is 32bit only. I used dumpbin /HEADERS fname.dll to check that this is a 64-bit file and it is:
File Type: DLL
FILE HEADER VALUES
8664 machine (x64)
D number of sections
5829E628 time date stamp Mon Nov 14 16:28:24 2016
0 file pointer to symbol table
0 number of symbols
F0 size of optional header
2022 characteristics
Executable
Application can handle large (>2GB) addresses
DLL
So, then I recompie for 32-bit and run the test again, but I get the same error. So I check that the file output (the DLL) is 32-bit and it does appear to be, here is the dumpbin for that:
File Type: DLL
FILE HEADER VALUES
14C machine (x86)
C number of sections
5829E792 time date stamp Mon Nov 14 16:34:26 2016
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
2102 characteristics
Executable
32 bit word machine
DLL
C++ Unit Test Works in the IDE
Using MSVS2015 IDE, I can compile and run my code/unit tests and they all work (when I use the x86 build) - and they all pass. If I select x64 build then it complains.
Specific Command That Fails
Here is the exact command line I am useing:
mstest /testcontainer:UnitTest_TrackManager.dll /detail:errormessage
It is run from the same location as the dll lives which is here:
D:\<somepath>\MiddlewareTest01\Debug\UnitTest_TrackManager.dll
Where <somepath> is just there to hide my PC/user details and MiddlewareTest01 is the solution folder.
As I say, I can get this to work for C# projects, but for C++ it does not seem to work in the same way.
Update
Using dependency-walker it tells me:
MICROSOFT.VISUALSTUDIO.TESTTOOLS.CPPUNITTESTFRAMEWORK.DLL was not found. Could this be an issue?

v8.5 - Error Compiling Parallel Transformer

I would appreciate if i can get some help in solving this issue for which i have been looking for information for over 2 days through various forums. Crying or Very sad Crying or Very sad
I have installed Infosphere Datastage v8.5 on windows environment for testing and have run a couple of jobs, but when i run a job containing a transformer i get compilation error.
Job: Row generator -> Tfx -> Sequential File
Based on my search through various forums i find that Similar issue has been faced by others as well.But i am unable to find a concrete answer regarding the following:
1. A Compiler that i need to install and the related SDK that needs to be installed along with it
2. or A combined pack that has both compiler+SDK
The Installation Guide talks about Microsoft Visual Studio .NET 2008 Express Edition C++: but does not mention which is the associated SDK that needs to be installed ?
or is there a newer version of C++ compiler+SDK that will work on my environment
My Environment Details:
OS - Windows Server 2008 R2(Standard) SP1 - 64 bit
IIS - Infosphere Information Server v8.5 64bit Multilingual
--================
.Net framework
--================
Microsoft .Net framework 1.1
Microsoft .Net framework 4 Client Profile
Microsoft .Net framework 4 Extended
--=====
SDK
--=====
Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1
This SDK created 2 directories path , which are as follows:
C:\Program Files\Microsoft SDKs
C:\Program Files (x86)\Microsoft Visual Studio 9.0
Windows Environment Variables:
INCLUDE - C:\IBM\SQLLIB\INCLUDE;C:\IBM\SQLLIB\LIB;C:\Program Files\Microsoft SDKs\Windows\v7.0\Include
LIB - C:\Program Files\Microsoft SDKs\Windows\v7.0\Lib;C:\IBM\SQLLIB\LIB
CLASSPATH - .;C:\IBM\SQLLIB\java\db2java.zip;C:\IBM\SQLLIB\java\db2jcc.jar;C:\IBM\SQLLIB\java\sqlj.zip;
C:\IBM\SQLLIB\java\db2jcc_license_cu.jar;C:\IBM\SQLLIB\bin;C:\IBM\SQLLIB\java\common.jar
Path - C:\IBM\InformationServer\Server\DSComponents\bin;C:\Program Files (x86)\MKS Toolkit\mksnt;C:\PROGRA~2\MKSTOO~1\bin64;C:\PROGRA~2\MKSTOO~1\bin;
C:\PROGRA~2\MKSTOO~1\bin\X11;C:\PROGRA~2\MKSTOO~1\mksnt;C:\IBM\InformationServer\ASBNode\apps\jre\bin\classic;C:\IBM\InformationServer\ASBNode\lib\cpp;
C:\IBM\InformationServer\ASBNode\apps\proxy\cpp\vc60\MT_dll\bin;%systemroot%\system32;%systemroot%;
%systemroot%\system32\wbem;%systemroot%\system32\windowspowershell\v1.0\;c:\program files (x86)\microsoft visual studio 9.0\vc\bin;
c:\program files (x86)\microsoft visual studio 9.0\common7\ide;c:\program files\ibm\gsk8\lib64;C:\IBM\SQLLIB\BIN;C:\IBM\SQLLIB\FUNCTION;
C:\IBM\SQLLIB\SAMPLES\REPL;C:\Windows/SysWOW64
Compiler information from windows command prompt:
c:\Users\skh>cl.exe
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
Datastage Environment Variables:
APT_COMPILEOPT (old): -W/TP -W/EHa -DAPT_USE_ANSI_IOSTREAMS -c -W/Zc:wchar_t-
APT_COMPILEOPT (new): -W/TP -W/EHa -DAPT_USE_ANSI_IOSTREAMS -c
APT_LINKOPT(old): -s -W/dll -W/base:0x50000000 -W/Zc:wchar_t-
APT_LINKOPT(new): -s -W/dll -W/base:0x50000000
The (old) represent the default values that DS Environment variables had. I ran my job which had a transformer but i got the compilation error.
I changed the Environment variable values to what is stated in (new), still i get the compilation error mentioned below
Output from transformer compilation follows:
I IIS-DSEE-TFCN-00001 12:55:36(000)
IBM WebSphere DataStage Enterprise Edition 8.5.0.5746
Copyright (c) 2001, 2005-2008 IBM Corporation. All rights reserved
##I IIS-DSEE-TFCN-00006 12:55:36(001) <main_program> conductor uname: -s=Windows_NT; -r=1; -v=6; -n=IN-MUM-IBMQLT; -m=Pentium
##I IIS-DSEE-TOSH-00002 12:55:36(002) <main_program> orchgeneral: loaded
##I IIS-DSEE-TOSH-00002 12:55:36(003) <main_program> orchsort: loaded
##I IIS-DSEE-TOSH-00002 12:55:36(004) <main_program> orchstats: loaded
##W IIS-DSEE-TOSH-00049 12:55:36(007) <main_program> Parameter specified but not used in flow: DSPXWorkingDir
##E IIS-DSEE-TBLD-00076 12:55:39(000) <main_program> Error when checking composite operator: Subprocess command failed with exit status 256.
##E IIS-DSEE-TFSR-00019 12:55:39(001) <main_program> Could not check all operators because of previous error(s)
##W IIS-DSEE-TFTM-00012 12:55:39(002) <transform> Error when checking composite operator: The number of reject datasets "0" is less than the number of input datasets "1".
##I IIS-DSEE-TBLD-00000 12:55:39(003) <main_program> Error when checking composite operator: Output from subprocess: cl : Command line warning D9035 : option 'GX' has been deprecated and will be removed in a future release
cl : Command line warning D9036 : use 'EHsc' instead of 'GX'
cl : Command line warning D9025 : overriding '/GX' with '/EHa'
##I IIS-DSEE-TBLD-00000 12:55:39(004) <main_program> Error when checking composite operator: Output from subprocess: C:\IBM\InformationServer\Server\PXEngine\include\apt_util/ints.h(83) : fatal error C1083: Cannot open include file: 'strstream': No such file or directory
##W IIS-DSEE-TFEV-00025 12:55:39(005) <transform> Error when checking composite operator: Converting string to number.
##W IIS-DSEE-TFEV-00023 12:55:39(006) <transform> Error when checking composite operator: Implicit conversion from source type "String" to result type "DFloat".
##W IIS-DSEE-TFEV-00025 12:55:39(007) <transform> Error when checking composite operator: Converting number to string.
##W IIS-DSEE-TFEV-00023 12:55:39(008) <transform> Error when checking composite operator: Implicit conversion from source type "DFloat" to result type "String".
##W IIS-DSEE-TBLD-00000 12:55:39(009) <main_program> Error when checking composite operator: Output from subprocess: ld: script execution error in file 'C:/PROGRA~2/MKSTOO~1/etc/nutccg/ld.ccg' on line 1119
>>> execv: could not run 'link32': The system cannot find the file specified.
##I IIS-DSEE-TBLD-00079 12:55:39(010) <transform> Error when checking composite operator: cxx -LC:/IBM/InformationServer/Server/Projects/PRJ_QSPOC/RT_BP2.O/ -LC:/IBM/InformationServer/Server/PXEngine/lib -LC:/IBM/InformationServer/Server/PXEngine/user_lib -s -W/dll -W/base:0x50000000 -lliborchnt -lliborchcorent -lliborchbuildopnt C:/IBM/InformationServer/Server/Projects/PRJ_QSPOC/RT_BP2.O/V0S3_TestJob_Tfx_Transformer.tmp.o -o C:/IBM/InformationServer/Server/Projects/PRJ_QSPOC/RT_BP2.O/V0S3_TestJob_Tfx_Transformer.dll.
##E IIS-DSEE-TCOS-00029 12:55:39(011) <main_program> Creation of a step finished with status = FAILED. (TestJob_Tfx.Transformer)
*** Internal Generated Transformer Code follows:
0001: //
0002: // Generated file to implement the V0S3_TestJob_Tfx_Transformer transform operator.
0003: //
0004:
0005: // define our input/output link names
0006: inputname 0 DSLink2;
0007: outputname 0 DSLink5;
0008:
0009: initialize {
0010: // define our control variables
0011: int8 RowRejected0;
0012: int8 NullSetVar0;
0013:
0014: }
0015:
0016: mainloop {
0017:
0018: // declare our intermediate variables for this section
0019: dfloat InterVar0_0;
0020:
0021: // initialise the rejected row variable
0022: RowRejected0 = 1;
0023:
0024: // evaluate columns (no constraints) for link: DSLink5
0025: InterVar0_0 = DSLink2.Dummy1;
0026: DSLink5.Dummy1 = (InterVar0_0 + 5);
0027: writerecord 0;
0028: RowRejected0 = 0;
0029: }
0030:
0031: finish {
0032: }
0033:
*** End of Internal Generated Transformer Code
This is how i went about fixing it. I hope this helps people facing similar problems and saves some time and effort.
so , here it goes :
I installed Visual Studio C++ 2008 Express Edition.
I then worked around vcvarsall.bat file .if you are wondering why , please check
(
http://msdn.microsoft.com/en-us/library/x4d2c09s(v=vs.80).aspx )
and
Errors while building/installing C module for Python 2.7
)
I executed the following from the cmd window, to set the 64 bit compiler:
vcvarsall.bat amd64
NOTE: my environment has a X64 AMD chipset windows server;I used echo %PROCESSOR_ARCHITECTURE% , from cmd window to determine this.
To cross check which compiler is set, execute the following and the output would indicate.
cl.exe
Next , set the following windows system variables:
INCLUDE - C:\IBM\SQLLIB\INCLUDE;C:\IBM\SQLLIB\LIB; C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
LIB - C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib ;C:\IBM\SQLLIB\LIB
Note:-
The folder path C:\Program Files\Microsoft SDKs\Windows\v6.0A is created by the Visual Studio C++ 2008 Express Edition. This should be the source for folder paths that are set for INCLUDE & LIB
There is a similar path that the SDK creates C:\Program Files\Microsoft SDKs\Windows\v7.0\ , but Include and Lib folder from this path should not be used to set the above mentioned Windows Environment variables , I made this mistake during my set up :(
for reference please check the Release Note of the SDK that is to be installed.
Set the following Datastage ENV variable,from the Administrator, to values below.
APT_COMPILEOPT : -W/TP -W/EHa -DAPT_USE_ANSI_IOSTREAMS -c -W/Zc:wchar_t-
APT_LINKOPT : -s -W/dll -W/base:0x50000000 -W/Zc:wchar_t-
I then restarted the Datastage services.
.. and the transformers started to work :)
PS : I did not uninstall Information Server nor the SDK (which i initially presumed was the problem)

Executing coded UI test from a target machine's mstest(standalone). Dll's/Files needed!! :(

i set up mstest on target machine as standalone program without installing visual studio. So i copied the files(*.exe's,dll's) mstest needed to the target machine and register all dlls in gac which mstest needs to run unit tests.
Works fine so far for normal unit tests.
Acually i try to setup mstest to run coded ui test. I copied some new dll's to the target machine:
- Microsoft.VisualStudio.QualityTools.CodedUITestFramework.dll
- Microsoft.VisualStudio.TestTools.UITest.Common.dll,TestTools.UITest.Extensions.dll
- Microsoft.VisualStudio.TestTools.UITesting.dll
- Microsoft.VisualStudio.HostingProcess.Utilities.Sync
But when i try to execute a test on cmd.exe via mstest.exe on my target machine, the test will run but always fail (works fine on my local machine, Visual Studio 2012). Its a pretty simple test:
- just click on "Start",
- type in "calc press enter"
Both machines use the same operating system.
I guess MSTest.exe still needs some dll's to perform codedUiTests. The bad thing is the missing dll's arent show up in cmd.exe, no errors, no hints just nothing :/
The test runs like normal but will fail all tests.
cmd-output:
Microsoft (R) Test Execution Command Line Tool Version 11.0.50727.1
Copyright (c) Microsoft Corporation. All rights reserved.
Loading D:\Users\Jenkins\Desktop\CodedUITestProject1\CodedUITestProject1\bin\Debug\CodedUITestProject1.dll...
Starting execution...
Results Top Level Tests
------- ---------------
Failed CodedUITestProject1.CodedUITest1.CodedUITestMethod1
0/1 test(s) Passed, 1 Failed
Summary
-------
Test Run Failed.
Failed 1
---------
Total 1
Results file: C:\VS2011Stub\Common7\IDE\TestResults\Jenkins_MSGP166C 2013-05-24 12_36_28.trx
Test Settings: Default Test Settings
Does anyone know what files mstest.exe needs to run codeduitests in a correct way?
Edit: I checked the *.trx file and copied the missing dll's to my target machine.
I tried to run the test again, it failed again. I was checking the trx file again and got an awesome message :/
<Results>
<UnitTestResult executionId="4652eeb1-e1b4-4782-a288-dbd4bb0bda5a" testId="484ddbfe-fdc6-0f5d-9e7b-bab4da5b5905" testName="CodedUITestMethod1" computerName="MSGP166C" duration="00:00:00.0887388" startTime="2013-05-24T16:30:24.1716290+02:00" endTime="2013-05-24T16:30:24.6266745+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Failed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="4652eeb1-e1b4-4782-a288-dbd4bb0bda5a">
<Output>
<ErrorInfo>
<Message>Error calling Initialization method for test class CodedUITestProject1.CodedUITest1: System.IO.FileNotFoundException: Das System kann die angegebene Datei nicht finden. (Ausnahme von HRESULT: 0x80070002)</Message>
<StackTrace> bei System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
bei System.Reflection.Assembly.LoadFile(String path)
bei Microsoft.VisualStudio.TestTools.UITest.Framework.UITestExtensionPackageManager.LoadAssembly(String assemblyFile)
</StackTrace>
</ErrorInfo>
</Output>
</UnitTestResult>
</Results>
So what Assembly is missing now?? It was not mentioned.
Thanks in Advance
Instead of trying to copy over the dlls I would install VS Test Agents. It's much lighter than visual studio and will get you mstest. This is the approach I use when running CodedUI tests on a test machine.
http://search.microsoft.com/en-us/DownloadResults.aspx?q=test+agents
Download the version of test agents that you built the project in.
(doesn't really matter)
There will be 3 options when you open the installer. You want test agents.
You should now have everything you need for mstest and codedui
Another that works well is putting all of your codedui tests into an ordered test and passing that into mstest.
MSTest /TestContainer:OrderedTest1.orderedtest
should do the trick