locked
UWP Unit Test does not show stacktrace for failed assertion RRS feed

  • Question

  • Hello,

    I need to run many assertion in 1 method but UWP Unit Test does not show stacktrace for failed assertion so it is impossible to know which line has failed, the only thing we can know is which method has failed. There are 2 screenshot of 



    1. Unit Test App (Universal Windows) project

    (New Project -> Visual C++ -> Windows Universal -> Unit Test App (Universal Windows))

    (I cannot upload screenshot as my account is not verified)

    2. Native Unit Test Project

    (New Project -> Visual C++ -> Test -> Native Unit Test Project)

    (I cannot upload screenshot as my account is not verified)

    Tuesday, March 13, 2018 2:12 AM

Answers

  • Hi Alan Sparrow,

    I have no workaround to resolve this issue currently, but I think your idea is reasonable.

    I have helped you submitted a User Voice to VS connect, I think engineers from the MS will evaluate this issue seriously:

    https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/33652540-line-numbers-in-stack-traces-for-uwp-apps

    You could vote and comment it.

    And you could mark this reply, which could help others who have the same idea to vote and comment it. Thank you very much.

    Regards,

    Judyzh


    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.

    • Proposed as answer by Judy ZhuY Friday, March 16, 2018 6:49 AM
    • Marked as answer by Alan Sparrow Monday, March 19, 2018 1:59 AM
    Friday, March 16, 2018 6:48 AM

All replies

  • Hi Alan Sparrow,

    Welcome to the MSDN forum.

    What’s version of Visual Studio do you use?

    According to your description, I test with Visual C++ Native Unit Test Project in Visual Studio 2017, it works fine.

    I suggest you update the Visual Studio to the latest version, test again, how about the result?

    If this issue persists, please have a try with following to troubleshoot this issue:

    1. Please close all VS instance, restart it as administrator.
    2. Please click Start->Developer Command Prompt for VS-> type “devenv.exe /ResetSettings”.
    3. Please try to repair your Visual Studio.

    >> I cannot upload screenshot as my account is not verified

    You could upload the screenshot to OneDrive and share a link here.

    If you could not share the link, please go to following link, and type “please verify my account”, Microsoft engineers there will help you verify your account.

    https://social.msdn.microsoft.com/Forums/en-US/090972cb-b81f-498f-b718-948caca975c4/verify-account-41?forum=reportabug

    Regards,

    Judyzh


    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 Judy ZhuY Wednesday, March 14, 2018 2:42 AM
    Wednesday, March 14, 2018 2:38 AM
  • Hello,

    Visual C++ Native Unit Test Project works fine.

    However, the problem is Unit Test App (Universal Windows) project. Can you please also check with this?


    Thursday, March 15, 2018 6:28 AM
  • Hi Alan Sparrow,

    Yes, the Unit Test App (Universal Windows) project in VS2015 does not show StackTrace for failed assertion.

    Based on my understanding, StackTrace Class is based on namespace “System.Diagnostics” in the .NET Framework, but UWP project is not based on the .NET Framework. So, we could not use StackTrace to find which line fails in UWP Unit Test project.

    Following thread describes the similar issue, you could have a look at it:

    # Line numbers in stack traces for UWP apps

    If you want to use this function in Unit Test App (Universal Windows) project, you could report this issue that post the feedback in the following link, Microsoft engineers will evaluate them seriously.

    http://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx

    Thanks for your understanding.

    Regards,

    Judyzh


    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.

    • Proposed as answer by Judy ZhuY Friday, March 16, 2018 1:33 AM
    • Unproposed as answer by Judy ZhuY Friday, March 16, 2018 6:48 AM
    Thursday, March 15, 2018 9:14 AM
  • Hello,

    I understand your explaination but I think this is a very neccessary feature to write good Unit Test. Do you suggest any solution? Does MS plan to implement this feature in later update?

    Friday, March 16, 2018 4:47 AM
  • Hi Alan Sparrow,

    I have no workaround to resolve this issue currently, but I think your idea is reasonable.

    I have helped you submitted a User Voice to VS connect, I think engineers from the MS will evaluate this issue seriously:

    https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/33652540-line-numbers-in-stack-traces-for-uwp-apps

    You could vote and comment it.

    And you could mark this reply, which could help others who have the same idea to vote and comment it. Thank you very much.

    Regards,

    Judyzh


    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.

    • Proposed as answer by Judy ZhuY Friday, March 16, 2018 6:49 AM
    • Marked as answer by Alan Sparrow Monday, March 19, 2018 1:59 AM
    Friday, March 16, 2018 6:48 AM
  • Thank you, I will mark this as answered. Hope more developers will vote to implement this feature.
    Monday, March 19, 2018 1:58 AM