locked
How to execute MsTest project as part of visual studio build of another projects RRS feed

  • Question

  • Hi 

    We have a project1 and added new Test projectTest am able to execute all testmehods using TestExplorer. Now I want to build this TestProject as part of Project1 build in visual studio 2015. 

    When we build solution it has to execute all test cases as well. if any test case fail build should stop 


    charantej

    Tuesday, March 14, 2017 2:09 PM

All replies

  • Hi charantej,

    Welcome to MSDN forum.

    First, select the tagin VS:

    Keep the icon selected, then VS will run the test after every build.

    Second, add the TestProject as reference to the Project1(which you will build):

    Right click Reference -> add reference:

     

    After, every time you build the Project1, the TestProject will run as well.

    You could get more information about this:

    https://msdn.microsoft.com/en-us/library/hh270865.aspx?f=255&MSPPError=-2147217396

    Feel free to let me know if you need more help.

    Best regards,

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Fletch Zhou Wednesday, March 15, 2017 3:31 AM
    Wednesday, March 15, 2017 3:31 AM
  • we are not seeing that option in test explorer for VS 2015. that is the reason posted in this forum.

    charantej

    Wednesday, March 15, 2017 8:10 AM
  • Hi friend,

    Please check which edition of VS 2015 do you use.

    VS2015 Enterprise edition offers this functionality, which the Community edition do not,  that's why there is no tab there.

    Best regards,

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    • Edited by Fletch Zhou Wednesday, March 15, 2017 8:44 AM
    • Proposed as answer by Fletch Zhou Friday, March 17, 2017 3:40 PM
    Wednesday, March 15, 2017 8:44 AM
  • Friend,

    Am using Visual Studio Professional 2015. 


    charantej

    Wednesday, March 15, 2017 9:12 AM
  • any other alternatives for professional edition

    charantej

    Wednesday, March 15, 2017 9:31 AM
  • Hi friend,

    Run tests after build only supports Enterprise edition:

    some other user also faced this issue:

    http://stackoverflow.com/questions/37673829/run-tests-after-build-not-showing-in-test-explorer

    And I've helped you submit a user voice here, you could go to vote and comment on it

    https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/18622708-run-tests-after-build-does-not-support-visual-stud

    Best regards,

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Fletch Zhou Wednesday, March 15, 2017 9:50 AM
    • Proposed as answer by Fletch Zhou Thursday, March 16, 2017 1:44 AM
    Wednesday, March 15, 2017 9:49 AM