0

I have developed some C++ code with Visual Studio 2015, which I have just committed to my Visual Studio Online repo. I notice it has a Test feature, in the options: Code, Work, Build, Test, Release. When developing the code, I built some Unit Tests, using Visual Studio's built-in test framework. Can I configure these to be run as part of the Test step in the repo, to ensure future build's pass requirements?

my unit tests are currently in the same solution as the code in a .vcxproj file which contains the actual tests as .cpp files.

2 Answers 2

1

If you just want run unit test, you can simply run it during the build process. When you create a build definition with "Visual Studio" under Build tab, it will contain following tasks: enter image description here

"Visual Studio Test" is used to run unit testing. Refer to this link for details: Set up automated testing for your builds

For the Test tab, it can be used to run more kinks of testing. Refer to this link for details: Testing Tools and Services

Sign up to request clarification or add additional context in comments.

Comments

0

There's some documentation on msdn about it : https://msdn.microsoft.com/en-us/library/jj155800.aspx

Having said that, here's a quick sum up walkthrough with VS2015 to test it :

  1. Open VS2015 x64 x86 (or the one suited for your system) Cross Tools Command Prompt (type VS2015 in your start menu).
  2. Test you can run VCTest.console : > VCTest.console /?
  3. Go in your project directory
  4. Run your project tests : > VCTest.console myProjectTest.dll
  5. Now all you have to do is to write the little scripts that will automate that and integrate them as hook in your repos.

3 Comments

I want to know how the test project can be configured to automatically run under "Test" on Visual Studio Online, which I think is only step 5, do you have any details on that?
I don't use visual studio online so I can't help you if it's a specific difference between the desktop and online version on the Test menu.
What I provided was information to run tests out of Visual studio as part of automatic build for example. If you need specific answer about something you could do with the desktop version but not with the online version, I'm afraid I can't answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.