Red Gate forums :: View topic - Unit Testing with MSTest.exe
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Memory Profiler 7
ANTS Memory Profiler 7 forum

Unit Testing with MSTest.exe

Search in ANTS Memory Profiler 7 forum
Post new topic   Reply to topic
Jump to:  
Author Message
GuyCox



Joined: 10 Aug 2011
Posts: 5

PostPosted: Wed Aug 10, 2011 6:15 pm    Post subject: Unit Testing with MSTest.exe Reply with quote

I'm attempting to initiate profiling using the MSTest.exe application and the /testcontainer argument and not having much luck .

A console message pops up an error message that quickly disappears before it can be viewed.

The working directory isn't addressed in the application note.

Is there a way to capture the console message? What is the relationship of the Start Directory to the location of the resulting results file?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6646

PostPosted: Fri Aug 12, 2011 1:19 pm    Post subject: Reply with quote

Thanks for your post. It's difficult to tell what's going on but if you want to see the console message I guess you could profile cmd.exe with arguments /K "mstest /testcontainer x" and that should theoretically keep the console open.

I don't quite understand the last bit... are you talking about Memory Profiler's current directory setting and the results produced by MSTEST?
Back to top
View user's profile Send private message
GuyCox



Joined: 10 Aug 2011
Posts: 5

PostPosted: Fri Aug 12, 2011 1:49 pm    Post subject: Reply with quote

There is a working directory in the options dialog -- it may have not been available when the the tech note on unit testing was writtin for version 6.3.

Whre are the testing results saved when running a unit test with MSText.exe?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6646

PostPosted: Fri Aug 12, 2011 2:53 pm    Post subject: Reply with quote

I'd assume they go in the working directory. I'd check the documentation for mstest. I'm afraid I don't know that much about it.
Back to top
View user's profile Send private message
GuyCox



Joined: 10 Aug 2011
Posts: 5

PostPosted: Fri Aug 12, 2011 5:29 pm    Post subject: Re: Reply with quote

Brian Donahue wrote:
Thanks for your post. It's difficult to tell what's going on but if you want to see the console message I guess you could profile cmd.exe with arguments /K "mstest /testcontainer x" and that should theoretically keep the console open.

I don't quite understand the last bit... are you talking about Memory Profiler's current directory setting and the results produced by MSTEST?


here's the commandline -- the cmd.exe /k made it even more complex with the nested quoted paths:

C:\Users\Guy\Documents\Visual Studio 2010\Projects\RedGateAntsDemo\TestProject1bin\Debug>profile /e:"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common
7\IDE\mstest.exe /testcontainer:TestProject1.dll

This is the location of the compiled test.. The profiler is on the path. The error is:

=========

System.NotSupportedException:
The given path's format is not supported.
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boo
lean needFullPath)
at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[
] str, Boolean needFullPath)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionA
ccess access, AccessControlActions control, String[] pathListOrig, Boolean check
ForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess
access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
at System.IO.Path.GetFullPath(String path)
at ↑☼♣.?☼♣.♦►♣(☼♣ )
at ↑☼♣.?☼♣.♦►♣(☼♣ )
at ↑☼♣.?☼♣.♦►♣(☼♣ )
at ↓☼♣.?☻.►‼(Licence )
at ↓☼♣.?☻.??♥(String[] )

But, it runs fine without the /testcontainer: option, it runs and gives the results for mstest.exe starting up and exxiting...
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6646

PostPosted: Fri Aug 12, 2011 5:40 pm    Post subject: Reply with quote

I think you want to try this:
Quote:
C:\Users\Guy\Documents\Visual Studio 2010\Projects\RedGateAntsDemo\TestProject1bin\Debug>profile /e:"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common 7\IDE\mstest.exe /args:"/testcontainer:TestProject1.dll"


You must put the arguments to the app being profiled in the args argument.
Back to top
View user's profile Send private message
GuyCox



Joined: 10 Aug 2011
Posts: 5

PostPosted: Mon Aug 15, 2011 3:25 pm    Post subject: Reply with quote

I take it that you didn't actually try the command line. I got pretty much the same error with your commandline cut and pasted into the command shell --


C:\Users\Guy\Documents\Visual Studio 2010\Projects\RedGateAntsDemo\TestProject1\bin\Debug>profile /e:"C:\Program Files (x86)\Microsoft Visual Stud
io 10.0\Common 7\IDE\mstest.exe /args:"/testcontainer:TestProject1.dll"
ANTS Performance Profiler Command Line Utility V6.3.0.147
==============================================================================
Copyright c Red Gate Software Ltd 2010-2011


== Initialising profiler

ANTS Performance Profiler evaluation
log4net:WARN XmlHierarchyConfigurator: Unable to set property [securityContext] on object [log4net.Appender.FileAppender] using value [log4net.Uti
l.NullSecurityContext.Instance] (with acceptable conversion types)

Exception
=========

System.NotSupportedException:
The given path's format is not supported.
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig,
Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean nee
dFullPath)
at System.IO.Path.GetFullPath(String path)
at ↑☼♣.?☼♣.♦►♣(☼♣ )
at ↑☼♣.?☼♣.♦►♣(☼♣ )
at ↑☼♣.?☼♣.♦►♣(☼♣ )
at ↓☼♣.?☻.►‼(Licence )
at ↓☼♣.?☻.??♥(String[] )


C:\Users\Guy\Documents\Visual Studio 2010\Projects\RedGateAntsDemo\TestProject1\bin\Debug>
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6646

PostPosted: Tue Aug 16, 2011 4:16 pm    Post subject: Reply with quote

Sorry didn't mean to not be thorough, but there was an obvious error with your command line. But now it looks like some bizarre error coming from Profiler. I would hazard a guess it can't write entries to the log file (%userprofile%\local settings\application data\red gate\ants performance profiler 6) Are there permissions on that folder?
Back to top
View user's profile Send private message
jrg



Joined: 02 Jul 2010
Posts: 13

PostPosted: Wed Aug 17, 2011 10:04 am    Post subject: Reply with quote

I think you're missing the closing " after mstest.exe.

Code:
Profile.exe /e:"c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe" /args:"/testcontainer:Foo.dll"


works for me.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group