Skip to content

Commit

Permalink
Write dll instead of target on abort, rename errors (#5115)
Browse files Browse the repository at this point in the history
  • Loading branch information
nohwnd authored Jun 20, 2024
1 parent 7264afa commit 5b69fd3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Microsoft.TestPlatform.Build/Tasks/VSTestTask2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,14 @@ protected override void LogEventsFromTextOutput(string singleLine, MessageImport
}

case "run-cancel":
// There is other overload that takes just message, and params, specifying the name of the first parameter explicitly so I don't
// accidentally use it, because that will throw error when message is null, which it always is (We provide that null as first parameter).
Log.LogError(subcategory: null, "TESTRUNCANCEL", null, TestFileFullPath?.ItemSpec ?? string.Empty, 0, 0, 0, 0, data[0]);
break;
case "run-abort":
Log.LogError(data[0]);
// There is other overload that takes just message, and params, specifying the name of the first parameter explicitly so I don't
// accidentally use it, because that will throw error when message is null, which it always is (We provide that null as first parameter).
Log.LogError(subcategory: null, "TESTRUNABORT", null, TestFileFullPath?.ItemSpec ?? string.Empty, 0, 0, 0, 0, data[0]);
break;
case "run-finish":
// 0 - Localized summary
Expand Down Expand Up @@ -222,7 +228,7 @@ protected override void LogEventsFromTextOutput(string singleLine, MessageImport
file ??= string.Empty;

// Report error to msbuild.
Log.LogError(null, "VSTEST1", null, file ?? string.Empty, lineNumber, 0, 0, 0, fullErrorMessage, null);
Log.LogError(null, "TESTERROR", null, file ?? string.Empty, lineNumber, 0, 0, 0, fullErrorMessage, null);
}
break;
default:
Expand Down

0 comments on commit 5b69fd3

Please sign in to comment.