| Author |
Message |
GuyCox
Joined: 10 Aug 2011 Posts: 5
|
Posted: Wed Aug 10, 2011 6:15 pm Post subject: Unit Testing with MSTest.exe |
|
|
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 |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6348 Location: Red Gate Software
|
Posted: Fri Aug 12, 2011 1:19 pm Post subject: |
|
|
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? _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
GuyCox
Joined: 10 Aug 2011 Posts: 5
|
Posted: Fri Aug 12, 2011 1:49 pm Post subject: |
|
|
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 |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6348 Location: Red Gate Software
|
Posted: Fri Aug 12, 2011 2:53 pm Post subject: |
|
|
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. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
GuyCox
Joined: 10 Aug 2011 Posts: 5
|
Posted: Fri Aug 12, 2011 5:29 pm Post subject: Re: |
|
|
| 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 |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6348 Location: Red Gate Software
|
Posted: Fri Aug 12, 2011 5:40 pm Post subject: |
|
|
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. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
GuyCox
Joined: 10 Aug 2011 Posts: 5
|
Posted: Mon Aug 15, 2011 3:25 pm Post subject: |
|
|
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 |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6348 Location: Red Gate Software
|
Posted: Tue Aug 16, 2011 4:16 pm Post subject: |
|
|
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? _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
jrg
Joined: 02 Jul 2010 Posts: 13
|
Posted: Wed Aug 17, 2011 10:04 am Post subject: |
|
|
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 |
|
 |
|