Dev
Dev

Reputation: 41

Order of execution of test cases in C++

I have written a sample .Net Framework Test Application program in C++ which contains 3 methods Test1,Test2,Test3 (using MSTest Framework). If I use VSTest.Console.exe to execute the test cases in release mode, the order of execution of test cases are getting reversed.,i.e.,Test3,Test2 and then in Test1.If I build the project in Debug mode the order is Test1,Test2,Test3

I tried to prioritize the test cases by adding the below lines before every test method , but the output is still same.

BEGIN_TEST_METHOD_ATTRIBUTE(TestMethod1)
            TEST_OWNER(L"OwnerName")
            TEST_PRIORITY(2)
END_TEST_METHOD_ATTRIBUTE()

Link :https://learn.microsoft.com/en-us/visualstudio/test/how-to-use-microsoft-test-framework-for-cpp?view=vs-2022

can any one help me , how to retain the order of execution of test cases when the project is build in release mode.. Thanks in advance!

Upvotes: 0

Views: 395

Answers (0)

Related Questions