Skip to content

Commit 5b69fd3

Browse files
authored
Write dll instead of target on abort, rename errors (#5115)
1 parent 7264afa commit 5b69fd3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Microsoft.TestPlatform.Build/Tasks/VSTestTask2.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,14 @@ protected override void LogEventsFromTextOutput(string singleLine, MessageImport
111111
}
112112

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

224230
// Report error to msbuild.
225-
Log.LogError(null, "VSTEST1", null, file ?? string.Empty, lineNumber, 0, 0, 0, fullErrorMessage, null);
231+
Log.LogError(null, "TESTERROR", null, file ?? string.Empty, lineNumber, 0, 0, 0, fullErrorMessage, null);
226232
}
227233
break;
228234
default:

0 commit comments

Comments
 (0)