Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public void OneTimeTearDown()
}

[Test]
[NonParallelizable]
public void TestProceedsAfterAllAfterTestHooksExecute()
{
var testResult = TestsUnderTest.Execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public void SomeTest()
}

[Test]
[NonParallelizable]
public void CheckThatLongRunningBeforeTestHooksCompleteBeforeTest()
{
var testResult = TestsUnderTest.Execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public void OneTimeTearDown()
}

[Test]
[NonParallelizable]
public void TestProceedsAfterAllAfterTestHooksExecute()
{
var testResult = TestsUnderTest.Execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public void OneTimeTearDown()
}

[Test]
[NonParallelizable]
public void TestProceedsAfterAllAfterTestHooksExecute()
{
var testResult = TestsUnderTest.Execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ private static IEnumerable<FailingReason> GetRelevantFailingReasons()
}

[TestSetupUnderTest]
[NonParallelizable]
[AfterSetUpOutcomeLogger]
[TestFixtureSource(nameof(GetFixtureConfig))]
public class TestsUnderTestsWithDifferentOntTimeSetUpOutcome
Expand Down Expand Up @@ -147,7 +146,7 @@ public void SomeTest()
}

[Test]
[NonParallelizable]

public void CheckSetUpOutcomes()
{
var testResult = TestsUnderTest.Execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ private static IEnumerable<FailingReason> GetRelevantFailingReasons()
// H-TODO: enrich or write new test for exceptions from hooks

[TestSetupUnderTest]
[NonParallelizable]
[AfterOneTimeTearDownOutcomeLogger]
[TestFixtureSource(nameof(GetFixtureConfig))]
public class TestsUnderTestsWithDifferentOneTimeTearDownOutcome
Expand Down Expand Up @@ -145,7 +144,7 @@ public void SomeTest()
}

[Test]
[NonParallelizable]

public void CheckOneTimeTearDownOutcomes()
{
var testResult = TestsUnderTest.Execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ private static IEnumerable<FailingReason> GetRelevantFailingReasons()
}

[TestSetupUnderTest]
[NonParallelizable]
[AfterSetUpOutcomeLogger]
[TestFixtureSource(nameof(GetFixtureConfig))]
public class TestsUnderTestsWithDifferentSetUpOutcome
Expand Down Expand Up @@ -146,7 +145,7 @@ public void SomeTest()
}

[Test]
[NonParallelizable]

public void CheckSetUpOutcomes()
{
var testResult = TestsUnderTest.Execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ private static IEnumerable<FailingReason> GetRelevantFailingReasons()
// H-TODO: enrich the test to also failing tests and setups

[TestSetupUnderTest]
[NonParallelizable]
[AfterTearDownOutcomeLogger]
[TestFixtureSource(nameof(GetFixtureConfig))]
public class TestsUnderTestsWithDifferentTearDownOutcome
Expand Down Expand Up @@ -137,7 +136,7 @@ public void SomeTest()
}

[Test]
[NonParallelizable]

public void CheckTearDownOutcomes()
{
var testResult = TestsUnderTest.Execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ TestResult testResult
public class AfterTestHooksEvaluateTestOutcomeTests
{
[TestSetupUnderTest]
[NonParallelizable]
[AfterTestOutcomeLogger]
public class TestsUnderTestsWithMixedOutcome
{
Expand Down Expand Up @@ -89,7 +88,7 @@ public void WarningTestWithWarnings()
}

[Test]
[NonParallelizable]

public void CheckThatAfterTestHooksEvaluateTestOutcome()
{
var testResult = TestsUnderTest.Execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public void TestFails_WithException()
}

[Test]
[NonParallelizable]
[Explicit("Thread IDs is not a good way to test. Are we testing dot net framework here??")]
public void AsynchronousHookInvocation_HookExecutesInSeparateThreads()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public void TestFails_WithException()
}

[Test]
[NonParallelizable]
public void SynchronousHookInvocation_HookExecutesInSameThreadAsTest()
{
var testResult = TestsUnderTest.Execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public void TestWithoutHookLogging()
}

[Test]
[NonParallelizable]
public void CheckLoggingTest()
{
var testResult = TestsUnderTest.Execute();
Expand Down
16 changes: 15 additions & 1 deletion src/NUnitFramework/tests/TestUtilities/TestsUnderTest/TestLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@

using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;

namespace NUnit.Framework.Tests.TestUtilities.TestsUnderTest;

public static class TestLog
{
public static List<string> Logs { get; } = new List<string>();
private static readonly AsyncLocal<List<string>> _logs = new AsyncLocal<List<string>>();

// Each aync context gets its own instance of TestLog
public static List<string> Logs
{
get
{
if (_logs.Value == null)
{
_logs.Value = new List<string>();
}
return _logs.Value;
}
}

public static void Log(string infoToLog)
{
Expand Down
Loading