Visual Studio Native C ++ unit test and output

tags: Edradation  unit test  c++

The unit test project can be created by the boot dialog. In the dialog box to create a regular item, search for Test, after a minute, the search results will appear, select the Native Test, create a unit test item.

After the creation is complete, the template code is automatically generated, and it can be written.

The default code generation mode is dynamically generated and can be switched. You can introduce a variety of static libraries, set a temporary file directory, and output directory like a regular project, and finally generate a DLL file, you can't run directly, you need to run in the unit test list, or right click on code -> Run Tests.

Do not modify the output directory on the setup page of the linker, otherwise, if the LINK output directory does not match the project output directory, the run unit test will not find the generated DLL, and there is no error message.

Unit test output information:

Logger::WriteMessage(L"123"); 

Print to the output window. Shortcut OLT + 2. However, each run, the output window automatically switches to build information, each time you need to switch back to Tests information, very troublesome.

As for the test list window, you will be automatically popped up each time. It is recommended to place this, the list window will adjust the layout for the upper and lower layout, it seems that this 2b interface is not too stupid:

Intelligent Recommendation

Unit testing C++ on Visual Studio 2017

After switching to Visual Studio for development, doing unit testing is also quite simple. Let's do a simple record below. 1.The tested project is as follows, this is aExecutable file engineering 2.On...

Unit testing in Visual Studio

Make sure yourVisual StudioThe Team Tester component is installed in (optional) After installation, it will beVisual StudioOne more "test" in the menu Create a new C# class library project a...

C#-Input and output (Visual Studio for Mac)

Record the process of learning C#, take a learning notes   It seems that there are not many articles about writing C#with Visual Studio for Mac The first day of learning is simple input and outpu...

Visual Studio unit test learning (second soft work)

Visual Studio unit test learning (second soft work) The second soft job is to choose your favorite IDE and perform simple unit tests. Considering that I want to learn c# language by the way, and write...

An example of debugging Vue's Unit Test in Visual Studio Code

There is a project based on vue 2.6 and vue-cli 3.0. When writing unit test in the project, how to use vs code for debugging? Refer to the external network link First of all, vs code debug unit test d...

More Recommendation

Visual Studio plugin CODERUSH V20.2.9 Release - New Unit Test Experience

DEVEXPRESS Technology Communication Group 3: 700924826 Welcome to group discussion CodeRushCan help you create and maintain source code with extremely high efficiency. Consime-first declaration, power...

How to write C / C ++ unit testing in Visual Studio using GoogleTest

Visual Studio contains the following C ++ testing framework, without the need for additional downloads: Microsoft unit testing framework applicable to the C ++ Google Test Boost.Test CTest After addin...

Test the C ++ standard supported by Visual Studio Community

Start debugging! ! enter   done!      ...

Visual studio C# language output debugging information to Output window method

Original: Visual studio C# language output debugging information to Output window method 1. Menu bar: Tools 》Options Debugging redirects all output window text to the instant window    ...

Visual Studio C # Language Output Debug Information to Output Window Method

1. Menu bar: Tools "Option" Debug "Redirects all Output Windows Text to Instant Windows            2. Add debugging information using C...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top