How to use the Unit test tool comes with VS2008 Pro to test a C++ proj? - c++

Here's what i've done:
i choose Test -> create new test -> wizard
Then it asked me to enter a proj name. i did.
then it told me to select a source proj to test, i chose my working proj... but...
a warning dialog popped up saying : "Unknown virtual address 0" and refuse to continue.
i tried rebuilding my source proj many times... no luck
can anyone help me out?

Here you will found full description of VS tests usage in c++. Citate - If your production code is written in Visual C++, you can generate unit tests only if your product uses the /clr:safe compiler option.

Related

boost-test 'filename'.test.report.xml not found

I use Visual Studio adapter for Boost.Test. I built boost.test[v1.59] project using cmake.
I didn't have any compile problems but when I tried to run tests I got the output like below:
Executing: -> [BoostUnitTestSample]
filestream was found to be null when handling path: D:\Work\Project\dev\DesktopMSVC13_Project\src\ProjectTest\Debug\ProjectTest.exe.test.report.xml
Exception caught while running test batch D:\Work\Project\dev\DesktopMSVC13_Project\src\ProjectTest\Debug\ProjectTest.exe [BoostUnitTestSample]
(File 'D:\Work\Project\dev\DesktopMSVC13_Project\src\ProjectTest\Debug\ProjectTest.exe.test.report.xml' not found.)
========== Run test finished: 0 run (0:00:03,6081912) ==========
Everything goes fine if I add a boost.test project manually
My experience with the Boost.Test extension for Visual Studio (see comment) tells me that you forgot to set references to dependencies required to run the tests (typically DLLs). I think the message is rather created by the standard test execution engine than by Boost.Test extension. It is just a clumsy way of saying "oh, the test did not run, so I could find the results..."

Netbeans IDE 8.0.2 C++ Input/Output Error

I installed netbeans C++ on windows 7 and used Cywgin4 as the compiler. When I run any program even a simple Hello world it does compile and run however I also get the error below. I can't seem to find any reference to it online. Can anyone point me in the right direction for a solution? Thanks!
read from master failed
: Input/output error
RUN FAILED (exit value 1, total time: 47ms)
I do not understand all the surrounding details of this problem as I am new to C/C++. However, if you:
Open up NetBeans
Right click on your C++ project file
Select "Properties"
There should be a category called "Run".
Under this category, find the option called Console Type and make sure that Standard Output is selected as shown in the screenshot below:
I was having the same problems when the console type was selected as Internal Terminal.
For my setup, changing this option to Standard Output got rid of this error. However, I do not fully understand how this change affects the overall properties of my project. Wish you good luck.

Unit Testing Framework - An error occurred while parsing entityname

I have created simple MS Unit Test Project. Assert.Equal(true, true).
When I want to run a test I receive a error from Resharper and Visual Studio.
"Unit test Runner failed to run tests
System.Xml.XmlException: An Error occured while parsing EnityName. Line 1, position 17."
Do I missing something.
Edit:
I can't add screenshot and I can't select text to copy. Ok I will write it the best I can.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.xml.XmlTextReaderImpl.Throw(String res,String arg)
at System.Xml.XmlText.ParseEnityName()
at System.Xml.XmlTextReaderImplparseEnityReference
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextLoader.ParsePartialContent(XmlNode parentNode,String innerxmltext, xmlNodeType nt)
at System.Xml.XmlElement.set_InnerXml(string value)
at Microsoft.VisualStudio.TestPlatform.Utilities.InferSettingHelper.AppendOrModifyChild(XpathNavigator,String nodePatH,String nodeNAME,sTRING INNERxML)
at Microsoft.VisualStudio.TestPlatform.Utilities.InferSettingsHelper.UpdatedRunConfiguration(XPathNavigator, ArchitectureeffectivePlatform,FrameworkVersion effectiveFramework,String resultsDirectory,String solutionDirectory,String binariesRootDirectory)
Microsoft.VisualStudio.TestPlatform.Utilities.InferSettingsHelper.MergeRunSettingsAndFindCompatibleSource()
at JetBrains.ReSharper.UnitTestProvider.MSTest11.MsTest11Runner.Run(IRemoteTaskServer server,String assemblyLocation,String runConfigurationFilename,IUnitTestRun run)
To solve this problem you don't need to reinstall Visual Studio or Resharper.
The problem was in a file path to my projects. This would explains why other Unit Test projects were fine because there were in a different location.
I guess this a bug inside Visual Studio Unit Testing Framework. If you have unit test project inside folders with special charts like '&' then Visual Studio will crash or Resharper will return this message.
I wonder where I can report this bug.
I have just run into this problem too and followed the advice above.
First my path had a folder named ...\m&e...
Then I copied the whole project folder to a new location without an '&' in the path.
After that everything was working well.

xcode4 - scheme test problem

How do you run your code to run through all scheme test cases in xcode4?
"the scheme '/name/' is not configured for testing. Edit the scheme to configure testing,... "
But I cant seem to set it up to test all the scheme cases.
Best to use the schemes that Xcode installed when you created the project: they have the test phase already configured. To execute the test, choose menu Product -> Test.

NDepend, TestDriven and HostType

I'm making use of the TestDriven.NET plugin for visual studio to run all my tests to check for code coverage with NDepend. All is working fine apart from my tests with a HostType attribute. These aren't getting run.
Does anybody knopw how to fix this or is there a specific reason for it?
Thanks in advance
If you look at the release notes for TestDriven.NET, they explicitly skip test with the HostType attribute. I'm not sure why they do this exactly.
I can actually not find another test runner outside of the built in runner in Visual Studio that will execute those tests, Resharper/dotCover gives me an Aborted message when running a specific test with a HostType
EDIT: Linked to release notes (look at item 3203) http://www.testdriven.net/downloads/releasenotes.html