Skip to content

Conversation

@edleno2
Copy link
Contributor

@edleno2 edleno2 commented May 14, 2021

Description

Replaced Debug.WriteLine with Console.WriteLine in UnitTestLauncher

Motivation and Context

Use of Debug required that UnitTestLauncher be built in Debug mode before putting into the Nuget repository. This change will allow Release builds to be put into the Nuget repository. Changes to mscorlib to allow access to the internal System.Console class have already been made.

How Has This Been Tested?

Tested by running the unit tests in Visual studio. Output was checked in the Tests output window of Visual Studio 2019. First tested current code and confirmed that a debug build will display the messages, but a release build did not display the messges. After changing verified that both Debug and Release produced output in the Tests output window.

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (work on Unit Tests, has no impact on code or features)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

edleno2 added 3 commits May 13, 2021 20:30
Prior to these were using Debug.WriteLine which does not work in a release build.  Using Console.WriteLine allows the TestLauncher to be built in Release mode when uploaded to Nuget.

Fix #738
@Ellerbach
Copy link
Member

@josesimoes is Console still present in nano? And are we sure the mechanism used behind is not using Debug and won't get removed from the compilation in Release?

@Ellerbach
Copy link
Member

Btw, that will apply to the Logging Framework as well.

Copy link
Member

@josesimoes josesimoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thanks.

@josesimoes
Copy link
Member

@josesimoes is Console still present in nano? And are we sure the mechanism used behind is not using Debug and won't get removed from the compilation in Release?

Yes. It wont' be removed on Release build and the output will show in the debugger channel as expected!

@josesimoes
Copy link
Member

Btw, that will apply to the Logging Framework as well.

Yes, that was already taken care of with this: nanoframework/nanoFramework.Logging#10

@josesimoes josesimoes changed the title Use Console.WriteLine in UnitTestLauncher for messages Replace Debug with Console.WriteLine for messages May 14, 2021
@josesimoes josesimoes merged commit 5f31a39 into nanoframework:develop May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UnitTestLauncher using Debug.WriteLine

4 participants